Reference: Outlook 2013 Windows 8
I have set a custom property on an outgoing mail using SetProperty. I am able to see this property and its value in the internet message header once the mail is received on another machine. I am not able to retrieve the value of this property using GetProperty even though, the property and its associated value exist in the received mail.
Property is set using the code below :
Const SchemaPrefix As String = "http://schemas.microsoft.com/mapi/string/"
Const SchemaCode As String = "{00020386-0000-0000-C000-000000000046}/ABC-ID"
Dim pa As Outlook.PropertyAccessor
Dim ID_Schema As String
Dim ID_Value As String
ID_Schema = SchemaPrefix & SchemaCode
ID_Value = "12345"
Set pa = item.PropertyAccessor
pa.SetProperty ID_Schema, ID_Value
In the mail received on another machine, I am able to see that the internet messager header contains :
ABC-ID: 12345
However, the following code fails, and returns the error -
The property "http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/ABC-ID" is unknown or cannot be found.
Error occurs on the last line : pa.GetProperty(ID_Schema)
Const SchemaPrefix As String = "http://schemas.microsoft.com/mapi/string/"
Const SchemaCode As String = "{00020386-0000-0000-C000-000000000046}/ABC-ID"
Dim pa As Outlook.PropertyAccessor
Dim ID_Schema As String
Dim objFolder As Folder
ID_Schema = SchemaPrefix & SchemaCode
Set objFolder = Outlook.ActiveExplorer.CurrentFolder
Set pa = objFolder.Items.item(1).PropertyAccessor
MsgBox pa.GetProperty(ID_Schema)
In the test folder, there is only one email... and I am able to manually verify the existence of the custom property and its value as set on the sending machine
Have found a few references on the web on how to set the property... but none on how to retrieve the property value. Guidance would be much appreciated.