none
Automating received Outlook forms to update external Access DB RRS feed

  • Question

  • The title sums it up.

    Once an outlook form has been received is there a way to populate an Access DB from the fields in the form?

    Is this possible?

    Where are some goods links in relation to design and considerations. 

    I'm new to Office development so a getting started guide would be useful.


    Thursday, November 19, 2015 1:43 AM

Answers

  • Hello Wally,

    Form fields values are stored as custom properties (user properties). You may try to use any low-level property viewer such as MFCMAPI or OutlookSpy for exploring hidden properties. The PropertyAccessor class from the Outlook object model can help with getting property values. For example:

    Sub DemoPropertyAccessorGetProperty()
        Dim PropName, Header As String
        Dim oMail As Object
        Dim oPA As Outlook.PropertyAccessor
        'Get first item in the inbox
        Set oMail = _
            Application.Session.GetDefaultFolder(olFolderInbox).Items(1)
        'PR_TRANSPORT_MESSAGE_HEADERS
        PropName = "http://schemas.microsoft.com/mapi/proptag/0x007D001E"
        'Obtain an instance of PropertyAccessor class
        Set oPA = oMail.PropertyAccessor
        'Call GetProperty
        Header = oPA.GetProperty(PropName)
        Debug.Print (Header)
    End Sub

    You may find the Getting Started with VBA in Outlook 2010 article helpful.

    Also see the How Do I... (Outlook 2013 PIA Reference) section in MSDN.

    Thursday, November 19, 2015 8:29 AM

All replies

  • I think what I am trying to do is:

    replicate items from an Outlook PST store into a back-end data repository



    Thursday, November 19, 2015 2:24 AM
  • Hello Wally,

    Form fields values are stored as custom properties (user properties). You may try to use any low-level property viewer such as MFCMAPI or OutlookSpy for exploring hidden properties. The PropertyAccessor class from the Outlook object model can help with getting property values. For example:

    Sub DemoPropertyAccessorGetProperty()
        Dim PropName, Header As String
        Dim oMail As Object
        Dim oPA As Outlook.PropertyAccessor
        'Get first item in the inbox
        Set oMail = _
            Application.Session.GetDefaultFolder(olFolderInbox).Items(1)
        'PR_TRANSPORT_MESSAGE_HEADERS
        PropName = "http://schemas.microsoft.com/mapi/proptag/0x007D001E"
        'Obtain an instance of PropertyAccessor class
        Set oPA = oMail.PropertyAccessor
        'Call GetProperty
        Header = oPA.GetProperty(PropName)
        Debug.Print (Header)
    End Sub

    You may find the Getting Started with VBA in Outlook 2010 article helpful.

    Also see the How Do I... (Outlook 2013 PIA Reference) section in MSDN.

    Thursday, November 19, 2015 8:29 AM