Item.UserProperties.Add signature

Add-in Express™ Support Service
That's what is more important than anything else

Item.UserProperties.Add signature

Posts: 56
Joined: 2006-07-21
1)Inspector inspector = (Inspector) InspectorObj;
2)AppointmentItem item = (AppointmentItem) inspector.CurrentItem;
3)lblStart.Text = item.Start.ToUniversalTime().ToString();
4)item.UserProperties.Add("RdzTest", OlUserPropertyType.olText, Type.Missing, Type.Missing);
5)lblEnd.Text = item.UserProperties.Count.ToString();

I have the above code in the ADXBeforeFormShow code event of an embedded form. Focussing on line 4), this is the only way i have been able to get it to work because for the item.UserProperties.Add() method:
parameter 3 is "AddToFolderFields" with type of object
parameter 4 is "DisplayFormat" with also type of object.

Could anyone tell me if this signature is correct and how I should make any corrections to my code in order to add a olText property to the item AND folder please?
Posted 24 Jul, 2006 10:47:06 Top

Posts: 56
Joined: 2006-07-21
Parameter 3 should be set to "true" i.e. a string - not true (a boolean)
I am not sure what Parameter 4 should be though so left it as Type.Missing but this combination of "true" and Type.Missing does add it to the folder.

The Type.Missing also works with the .Find() method.
Posted 24 Jul, 2006 11:30:18 Top
Sergey Grischenko

Add-in Express team

Posts: 7235
Joined: 2004-07-05
Hi Harry.

You can set the parameter 4 to 'Type.Missing'.
Please read about the 'User Properties' collection in the Microsoft Visual Basic Help in Outlook.
Posted 25 Jul, 2006 09:46:34 Top