Using .Restrict with a UserProperty in an Exchange folder

Mark Stepan

New Member
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
I found some code that indicated that a FOLDER-level user-defined field (UserProperty) could be used in a Restrict filter. It doesn't seem to work for me (I get a "property unknown" error). Does it only work with LOCAL (.PST) folders, or am I missing something to get it to work when dealing with Exchange folders? Thanks in advance.
 

Mark Stepan

New Member
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
Therein lies the rub I think. The folder in question is an Exchange folder of Calendar items. I wasn't able to add a user property to it.
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Simply change your code: Before using the Restrict, check Folder.UserDefinedProperties to see whether or not the prop exists. If it doesn't, add it. If that throws an error, you know you need to contact the admin
 
Top