I'm adding a custom property AT FOLDER LEVEL in Outlook 2010. MAPIFolder
(and Folder
) object has a property named UserDefinedProperties
where one can add custom properties, but the problem is that these properties are not meant to store values with them. As a hack I was storing property value right within the name by separating the two with a EQUAL sign, e.g. I'd add a UserDefinedProperty
whose Name
would be something like "MyProperty=123".
Now the problem is that sometime the value of my property contains characters that are not allowed in the Name
. For example, I have a property whose value is "America/New_York". These two characters (slash and underscore) are not allowed in the Name
, so I get an exception.
What I need here is either a better way to store a property value at folder level, or alternately, a list of allowed characters in the Name
property of a UserDefinedProperty
object, so that I could do some kind of replacement.
I'm using C#, .NET Fx 4.0 and VSTO.