So, I have a custom email form/message like below and I want to access the "Doc Title:" field value to insert it into the body of the email.
I currently have this code;
Function Item_Send()
Item.Body = Item.Body + UserProperties.Find("TextBox1").Text
End Function
And I've tried multiple variations of this, such as Item.UserProperties.Find(...).Value
, Find(...).Value
by itself, UserProperties.Find("TextBox1", false).Text
, etc.
Research;
CodeProject
MSDN Find Method Documentation
Microsoft Support - How to create an email message form
Microsoft Support - FAQ about custom outlook forms
Microsfot Support - Working with User Defined Fields
I just can't seem to find a solution.
The posted code returns Object requred: 'UserProperties.Find(...)'
If I add in false
to the parameters I get; Object doesn't support this property of method: 'UserProperties.Find'
Find by itself gives me Type mismatch: 'Find'
And that's all the error messages I can get to come up. Any help would be greatly appreciated. (I'm using the Script Editor button to write the above code, not the Visual Basic button).
Change the problematic line to
Also make sure the property name is really "TextBox1", that sounds like a control name. Have a look at the item with OutlookSpy: click Item button, select the UserProperties property, click browse, go to the IEnumVariant tab, double click on the property.
You can also click the IMessage button to see the raw MAPI properties.