View Single Post
  #4  
Old November 7th 06, 12:26 AM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default How to add a UserProperty to a MAPIFolder?

Create a PostItem in the folder, not a MailItem, and use True for the third parameter of UserProperties.Add.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"P Hoppe" wrote in message ...
What exactly need to be done to the MailItem for this to work?

I have the following code (C#):
dummyMailItem.UserProperties.Add("Dummy", Outlook.OlUserPropertyType.olText,
true, System.Type.Missing);
dummyMailItem.Subject = "Dummy";
dummyMailItem.Body = "Dummy";
dummyMailItem.To = ";
dummyMailItem.Save();
//dummyMailItem.Delete();

However, the mail item isn't added to the folder, and the user property
isn't added as user propertiy column.

Why not?

Ads