S
Stefan Becker
Hi I have tried to add an userproperty to specific messages using vba.
My code works from time to time. However it does not work all the
time. So far I have not figured out on what that depends.
Is there any specific thing I have to do after having added the
userproperty? Do I have to save the mailitem (I have tried that, but
could not find any difference in behaviour) ?
My (simplified) code is attached below:
Set fldFolder =
GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
For Each fldSubFolder In fldFolder.Folders
For Each mitMessage In fldSubFolder.Items
mitMessage.UserProperties.Add("ExUserProperty", olYesNo) =
True
'mitMessage.Save
Next
Next
My code works from time to time. However it does not work all the
time. So far I have not figured out on what that depends.
Is there any specific thing I have to do after having added the
userproperty? Do I have to save the mailitem (I have tried that, but
could not find any difference in behaviour) ?
My (simplified) code is attached below:
Set fldFolder =
GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
For Each fldSubFolder In fldFolder.Folders
For Each mitMessage In fldSubFolder.Items
mitMessage.UserProperties.Add("ExUserProperty", olYesNo) =
True
'mitMessage.Save
Next
Next