Accessing user defined fields in an Outlook message
If you have a reference to an outlook mailitem
and wish to access the user defined fields within that message then all you need
to do is use
Dim olmail as Outlook.Mailitem
Set olmail = 'whatever method you use to get the mailitem in question
Msgbox olmail.userproperties.item("fieldname") |
This method will allow you get all the values out
of a custom form so you could strip them into a database.
If you do not know what fields are in the form then the following bit of code
allows you to loop through all user defined fields
Dim olmail As Outlook.MailItem
Dim fld As Outlook.UserProperty
For Each fld In olmail.UserProperties
msgbox "Field Name : " &
fld.name & vbcrlf & "Field Value : " & fld.value
Next |
|