none
Outlook add-in, appointment form with OCX and a problem with it being a one off. RRS feed

  • Question

  • I have an add-in that contains a DLL and an OCX control, built in VB6.  Each is separate, meaning that the add-in consists of Addin.DLL and Addin.OCX.  The add-in uses a custom form, which is built off of the IPM.Appointment form in Outlook.  It is deployed to the user's machine as an OFT file and is published to their Presonal Forms Library in the initial OnConnection of the add-in. 
    I was having issues with the form being stuck in a one off state, which required me to add code similar the following to my AppointmentItem Write and PropertyChange class: 
       
    Private Sub AppointmentItem_PropertyChange(ByVal name As String)
            On Error GoTo ErrorHandler
            Select Case name
                Case "MessageClass"
                    Dim strGuid As String
                    ' Check to see if this is one of our appointmentitems. 
                    If IsItemUserItem(AppointmentItem_PropertyChange, strGuid) Then
                            ' Change to our add-in message class.  IPM.Appointment.XXX
                            AppointmentItem.MessageClass = gFormMsgClass
                    End If
            End Select
        
        done:
            Exit Sub
        
        ErrorHandler:
            Trace "Error writing appointment item."
            Resume done
     End Sub


    This works for most cases.  However, I'm still running into instances where when I check the item during the NewInspector event if it is an Exception I cannot access UserProperties, which are used to facilitate data sharing between the DLL and OCX.  
    Additionally when trying to edit the form in the form designer, I cannot save the form as an OFT from Outlook 2007.  I'm kind of at a loss as to what is going on with this...Any help is appreciated. 



    • Edited by Adam Altemus Wednesday, January 25, 2012 9:53 PM
    Wednesday, January 25, 2012 9:47 PM

Answers

  • First, take a look at the information at http://www.outlookcode.com/article.aspx?ID=35. For specific information on how forms get one-offed, see http://www.outlookcode.com/article.aspx?id=34.
     
    I would check to see if item.FormDescription.OneOff is true to test for a one-off state in an item "item".
     
    The information on cleaning up one-offed items is a bit out of date, CDO is not recommended for use with Outlook 2010 for example, but much of what you would do with CDO can be done with PropertyAccessor in Outlook 2007 or 2010.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Adam Altemus" <=?utf-8?B?QWRhbSBBbHRlbXVz?=> wrote in message news:b51bed65-b96c-48c7-b245-b6e7f4afabab...
    I have an add-in that contains a DLL and an OCX control, built in VB6.  Each is separate, meaning that the add-in consists of Addin.DLL and Addin.OCX.  The add-in uses a custom form, which is built off of the IPM.Appointment form in Outlook.  It is deployed to the user's machine as an OFT file and is published to their Presonal Forms Library in the initial OnConnection of the add-in. 
    I was having issues with the form being stuck in a one off state, which required me to add code similar the following to my AppointmentItem Write and PropertyChange class: 
       
    Private Sub AppointmentItem_PropertyChange(ByVal name As String)
            On Error GoTo ErrorHandler
            Select Case name
                Case "MessageClass"
                    Dim strGuid As String
                    ' Check to see if this is one of our appointmentitems. 
                    If IsItemUserItem(AppointmentItem_PropertyChange, strGuid) Then
                            ' Change to our add-in message class.  IPM.Appointment.XXX
                            AppointmentItem.MessageClass = gFormMsgClass
                    End If
            End Select
        
        done:
            Exit Sub
        
        ErrorHandler:
            Trace "Error writing appointment item."
            Resume done
     End Sub


    This works for most cases.  However, I'm still running into instances where when I check the item during the NewInspector event if it is an Exception I cannot access UserProperties, which are used to facilitate data sharing between the add-in and DLL.  
    Additionally when trying to edit the form in the form designer, I cannot save the form as an OFT from Outlook 2007.  I'm kind of at a loss as to what is going on with this...Any help is appreciated. 



    Ken Slovak MVP - Outlook
    • Marked as answer by Adam Altemus Wednesday, February 1, 2012 9:51 PM
    Wednesday, January 25, 2012 10:03 PM
    Moderator