Outlook 2003: Newly added UserProperties are not beeing remembered

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top