How do I add user-defined field to folder in C#?

M

Mikael

Hi!


I am coding a solution that has a function to sync it's database with
Outlook. I use a User-Defined Field to keep track of "my" items and it works
great. BUT - I can not find a way to add the user-defined field to the
folder programmatically. If an app is to be distributet widely I can't ask
my users to do this by hand.

I have noticed that som apps (like Skype) has added user-defined fields
automatically, so there has to be a way - do you know or could you point me
in the right direction? I'm coding in C# and Visual Studio 2005.

Regards
Mikael
Sweden
 
K

Ken Slovak - [MVP - Outlook]

That's one of the arguments when you create a UDF:

Outlook.UserProperty myUDF =
(Outlook.UserProperty)item.UserProperties.Add("myProp",
OlUserPropertyType.olText, true, missing);

Where "missing" is a missing value for display format.

When you add that user property to an item in the folder that way it creates
it as a UDF in the folder.
 
M

Mikael

Thanx.

I did not get that to work earlier for some reason - maybe because I used
false insted of Missing.Value...

Regards
Mikael
 

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