TaskItem UserProperties are lost !!!

G

Guest

Hi,
I add a couple of UserProperties to taskitems. but these properties are lost
once i shutdown and open outlook again. The code that adds property is

Outlook.UserProperty prop = null;
prop = item.UserProperties.Find("Project",missing);
if(prop == null)
{
prop =
item.UserProperties.Add("Project",Outlook.OlUserPropertyType.olText,missing,missing);
}
prop.Value = projectName;

Properties are also added to the folder. Using the field chooser i can see
the userproperty and its value. Once i close my outlook app and open it
again. i can see the same customproperty in the task view. when
programmatically it shows that the taskItem has 0 userproperties..

thanks
 
S

Sue Mosher [MVP-Outlook]

Are you saving the item after you add the property and set its value?
 
G

Guest

Thanks Sue,
Yes i',m saving the item after adding the properties. The userproperties are
there as long as outlook is open. If i close and open outlook, i can other
item properties such as subject, start date etc..but the item userproperty
count is 0. Although i can see the value of a userproperty in the task folder
- simple view. When tried to access it, it says that there are no
userproperties.

thanks
 
S

Sue Mosher [MVP-Outlook]

Can you show a code snippet that shows how you're trying to accessing the property? What does Outlook Spy or MFCMAPI show?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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