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
"Sue Mosher [MVP-Outlook]" wrote:
> Are you saving the item after you add the property and set its value?
>
> --
> Sue Mosher, Outlook MVP
> Author of
> Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
>
> "back2grid" <(E-Mail Removed)> wrote in message news:144DDDC8-08B0-46C6-A849-(E-Mail Removed)...
> > 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
>