 |
|
|
|
| Author |
Message |
Steve
Joined: 12 Aug 2007 Posts: 37
|
Posted: Fri Nov 16, 2007 10:38 am Post subject: More on UserProperties |
|
|
1) I have seen other MVP's say that when a UserProperty is added the item
should be saved , can you safely add many items (like many user properties)
before actually saving the item?
2) I am working on an Outlook addin that works great on my dev machine but
appearantly doesn't save/read userproperties for appointment items but task
items appearantly read/save fine on most systems.
Archived from group: microsoft>public>outlook>program_addins |
|
| Back to top |
|
 |
Dmitry Streblechenko
Joined: 12 Aug 2007 Posts: 220
|
Posted: Fri Nov 16, 2007 3:32 pm Post subject: Re: More on UserProperties |
|
|
1.Yes, you can set any number of properties before calling Save
2. Provide the relevant snippets of your code and indicate what exactly does
not work.
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Steve" wrote in message @microsoft.com...
> 1) I have seen other MVP's say that when a UserProperty is added the item
> should be saved , can you safely add many items (like many user
> properties)
> before actually saving the item?
>
> 2) I am working on an Outlook addin that works great on my dev machine but
> appearantly doesn't save/read userproperties for appointment items but
> task
> items appearantly read/save fine on most systems.
>
> |
|
| Back to top |
|
 |
Steve
Joined: 12 Aug 2007 Posts: 37
|
Posted: Fri Nov 16, 2007 10:24 pm Post subject: Re: More on UserProperties |
|
|
Dmitry
Please use my comment for your product OutlookSpy: WOW! It does what it
says!
As hard as it was to articulate the differences between two systems with
your tool I think I may have found something, finally.
Dmitry although it does require some explaination - looking at the IMessage
GetProps tab I see lots of differences in number of properties with each
Appointment item and values. As I suspected my userproperties have no values
in the system/version that doesn't work. one property that is interesting is
http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/urn:schemas:calendar:version.
BTW the value is 2.0. I don't see this one on systems that do work for my
Outlook Addin. Do you know what its for?
Can you offer an explanation why aren't my properties storing values? Is it
possible my properties somehow depend on the property offset?
"Dmitry Streblechenko" wrote:
> 1.Yes, you can set any number of properties before calling Save
> 2. Provide the relevant snippets of your code and indicate what exactly does
> not work.
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "Steve" wrote in message
> @microsoft.com...
> > 1) I have seen other MVP's say that when a UserProperty is added the item
> > should be saved , can you safely add many items (like many user
> > properties)
> > before actually saving the item?
> >
> > 2) I am working on an Outlook addin that works great on my dev machine but
> > appearantly doesn't save/read userproperties for appointment items but
> > task
> > items appearantly read/save fine on most systems.
> >
> >
>
>
> |
|
| Back to top |
|
 |
Dmitry Streblechenko
Joined: 12 Aug 2007 Posts: 220
|
Posted: Sat Nov 17, 2007 5:23 am Post subject: Re: More on UserProperties |
|
|
What is your code that sets the propeties and saves the item?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Steve" wrote in message @microsoft.com...
> Dmitry
> Please use my comment for your product OutlookSpy: WOW! It does what
> it
> says!
>
> As hard as it was to articulate the differences between two systems with
> your tool I think I may have found something, finally.
>
> Dmitry although it does require some explaination - looking at the
> IMessage
> GetProps tab I see lots of differences in number of properties with each
> Appointment item and values. As I suspected my userproperties have no
> values
> in the system/version that doesn't work. one property that is interesting
> is
> http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/urn:schemas:calendar:version.
> BTW the value is 2.0. I don't see this one on systems that do work for my
> Outlook Addin. Do you know what its for?
> Can you offer an explanation why aren't my properties storing values? Is
> it
> possible my properties somehow depend on the property offset?
>
> "Dmitry Streblechenko" wrote:
>
>> 1.Yes, you can set any number of properties before calling Save
>> 2. Provide the relevant snippets of your code and indicate what exactly
>> does
>> not work.
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "Steve" wrote in message
>> @microsoft.com...
>> > 1) I have seen other MVP's say that when a UserProperty is added the
>> > item
>> > should be saved , can you safely add many items (like many user
>> > properties)
>> > before actually saving the item?
>> >
>> > 2) I am working on an Outlook addin that works great on my dev machine
>> > but
>> > appearantly doesn't save/read userproperties for appointment items but
>> > task
>> > items appearantly read/save fine on most systems.
>> >
>> >
>>
>>
>> |
|
| Back to top |
|
 |
Steve
Joined: 12 Aug 2007 Posts: 37
|
Posted: Sat Nov 17, 2007 10:24 am Post subject: Re: More on UserProperties |
|
|
Ok here's what I got:
Microsoft.Office.Interop.Outlook.AppointmentItem appt;
string propertyName = "MyProp";
// if the property doesn't exist
if(!appt.UserProperties.Find(propertyName,Type.Missing))
{
appt.UserProperties.Add(propertyName,Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText, Type.Missing, Type.Missing);
}
appt.UserProperties[propertyName].Value = value;
appt.Save();
Steve
"Dmitry Streblechenko" wrote:
>
> What is your code that sets the propeties and saves the item?
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "Steve" wrote in message
> @microsoft.com...
> > Dmitry
> > Please use my comment for your product OutlookSpy: WOW! It does what
> > it
> > says!
> >
> > As hard as it was to articulate the differences between two systems with
> > your tool I think I may have found something, finally.
> >
> > Dmitry although it does require some explaination - looking at the
> > IMessage
> > GetProps tab I see lots of differences in number of properties with each
> > Appointment item and values. As I suspected my userproperties have no
> > values
> > in the system/version that doesn't work. one property that is interesting
> > is
> > http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/urn:schemas:calendar:version.
> > BTW the value is 2.0. I don't see this one on systems that do work for my
> > Outlook Addin. Do you know what its for?
> > Can you offer an explanation why aren't my properties storing values? Is
> > it
> > possible my properties somehow depend on the property offset?
> >
> > "Dmitry Streblechenko" wrote:
> >
> >> 1.Yes, you can set any number of properties before calling Save
> >> 2. Provide the relevant snippets of your code and indicate what exactly
> >> does
> >> not work.
> >>
> >> Dmitry Streblechenko (MVP)
> >> http://www.dimastr.com/
> >> OutlookSpy - Outlook, CDO
> >> and MAPI Developer Tool
> >>
> >> "Steve" wrote in message
> >> @microsoft.com...
> >> > 1) I have seen other MVP's say that when a UserProperty is added the
> >> > item
> >> > should be saved , can you safely add many items (like many user
> >> > properties)
> >> > before actually saving the item?
> >> >
> >> > 2) I am working on an Outlook addin that works great on my dev machine
> >> > but
> >> > appearantly doesn't save/read userproperties for appointment items but
> >> > task
> >> > items appearantly read/save fine on most systems.
> >> >
> >> >
> >>
> >>
> >>
>
>
> |
|
| Back to top |
|
 |
Dmitry Streblechenko
Joined: 12 Aug 2007 Posts: 220
|
Posted: Sat Nov 17, 2007 4:02 pm Post subject: Re: More on UserProperties |
|
|
Try the following instead:
UserProperty prop = appt.UserProperties.Find(propertyName,Type.Missing);
if (prop == null) prop = appt.UserProperties.Add(propertyName,
OlUserPropertyType.olText, Type.Missing, Type.Missing);
prop.Value = value;
appt.Save;
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Steve" wrote in message @microsoft.com...
> Ok here's what I got:
>
> Microsoft.Office.Interop.Outlook.AppointmentItem appt;
> string propertyName = "MyProp";
>
> // if the property doesn't exist
> if(!appt.UserProperties.Find(propertyName,Type.Missing))
> {
>
> appt.UserProperties.Add(propertyName,Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText,
> Type.Missing, Type.Missing);
> }
> appt.UserProperties[propertyName].Value = value;
> appt.Save();
>
> Steve
>
> "Dmitry Streblechenko" wrote:
>
>>
>> What is your code that sets the propeties and saves the item?
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "Steve" wrote in message
>> @microsoft.com...
>> > Dmitry
>> > Please use my comment for your product OutlookSpy: WOW! It does
>> > what
>> > it
>> > says!
>> >
>> > As hard as it was to articulate the differences between two systems
>> > with
>> > your tool I think I may have found something, finally.
>> >
>> > Dmitry although it does require some explaination - looking at the
>> > IMessage
>> > GetProps tab I see lots of differences in number of properties with
>> > each
>> > Appointment item and values. As I suspected my userproperties have no
>> > values
>> > in the system/version that doesn't work. one property that is
>> > interesting
>> > is
>> > http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/urn:schemas:calendar:version.
>> > BTW the value is 2.0. I don't see this one on systems that do work for
>> > my
>> > Outlook Addin. Do you know what its for?
>> > Can you offer an explanation why aren't my properties storing values?
>> > Is
>> > it
>> > possible my properties somehow depend on the property offset?
>> >
>> > "Dmitry Streblechenko" wrote:
>> >
>> >> 1.Yes, you can set any number of properties before calling Save
>> >> 2. Provide the relevant snippets of your code and indicate what
>> >> exactly
>> >> does
>> >> not work.
>> >>
>> >> Dmitry Streblechenko (MVP)
>> >> http://www.dimastr.com/
>> >> OutlookSpy - Outlook, CDO
>> >> and MAPI Developer Tool
>> >>
>> >> "Steve" wrote in message
>> >> @microsoft.com...
>> >> > 1) I have seen other MVP's say that when a UserProperty is added the
>> >> > item
>> >> > should be saved , can you safely add many items (like many user
>> >> > properties)
>> >> > before actually saving the item?
>> >> >
>> >> > 2) I am working on an Outlook addin that works great on my dev
>> >> > machine
>> >> > but
>> >> > appearantly doesn't save/read userproperties for appointment items
>> >> > but
>> >> > task
>> >> > items appearantly read/save fine on most systems.
>> >> >
>> >> >
>> >>
>> >>
>> >>
>>
>>
>> |
|
| Back to top |
|
 |
Steve
Joined: 12 Aug 2007 Posts: 37
|
Posted: Sat Nov 17, 2007 10:29 pm Post subject: Re: More on UserProperties |
|
|
Thank you for the reply unfortunately it still doesn't work on all machines.
However the changes didn't break anything on previously working machines.
First let me apologize for double posting Ken Slovak politely yelled at me
for also posting in the VSTO newsgroup. Ken my apologies. Dmitry - I
noticed your app which works perfectly well on several machines I'm working
with for testing uses a different interface. Some sample code also on
outlookcode.com by Helmut Obertanner that was inspired by yourself that
doesn't use the Outlook Object Model. Is this another potentially better
more generic approach?
Thanks
Steve
"Dmitry Streblechenko" wrote:
> Try the following instead:
>
> UserProperty prop = appt.UserProperties.Find(propertyName,Type.Missing);
> if (prop == null) prop = appt.UserProperties.Add(propertyName,
> OlUserPropertyType.olText, Type.Missing, Type.Missing);
> prop.Value = value;
> appt.Save;
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "Steve" wrote in message
> @microsoft.com...
> > Ok here's what I got:
> >
> > Microsoft.Office.Interop.Outlook.AppointmentItem appt;
> > string propertyName = "MyProp";
> >
> > // if the property doesn't exist
> > if(!appt.UserProperties.Find(propertyName,Type.Missing))
> > {
> >
> > appt.UserProperties.Add(propertyName,Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText,
> > Type.Missing, Type.Missing);
> > }
> > appt.UserProperties[propertyName].Value = value;
> > appt.Save();
> >
> > Steve
> >
> > "Dmitry Streblechenko" wrote:
> >
> >>
> >> What is your code that sets the propeties and saves the item?
> >>
> >> Dmitry Streblechenko (MVP)
> >> http://www.dimastr.com/
> >> OutlookSpy - Outlook, CDO
> >> and MAPI Developer Tool
> >>
> >> "Steve" wrote in message
> >> @microsoft.com...
> >> > Dmitry
> >> > Please use my comment for your product OutlookSpy: WOW! It does
> >> > what
> >> > it
> >> > says!
> >> >
> >> > As hard as it was to articulate the differences between two systems
> >> > with
> >> > your tool I think I may have found something, finally.
> >> >
> >> > Dmitry although it does require some explaination - looking at the
> >> > IMessage
> >> > GetProps tab I see lots of differences in number of properties with
> >> > each
> >> > Appointment item and values. As I suspected my userproperties have no
> >> > values
> >> > in the system/version that doesn't work. one property that is
> >> > interesting
> >> > is
> >> > http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/urn:schemas:calendar:version.
> >> > BTW the value is 2.0. I don't see this one on systems that do work for
> >> > my
> >> > Outlook Addin. Do you know what its for?
> >> > Can you offer an explanation why aren't my properties storing values?
> >> > Is
> >> > it
> >> > possible my properties somehow depend on the property offset?
> >> >
> >> > "Dmitry Streblechenko" wrote:
> >> >
> >> >> 1.Yes, you can set any number of properties before calling Save
> >> >> 2. Provide the relevant snippets of your code and indicate what
> >> >> exactly
> >> >> does
> >> >> not work.
> >> >>
> >> >> Dmitry Streblechenko (MVP)
> >> >> http://www.dimastr.com/
> >> >> OutlookSpy - Outlook, CDO
> >> >> and MAPI Developer Tool
> >> >>
> >> >> "Steve" wrote in message
> >> >> @microsoft.com...
> >> >> > 1) I have seen other MVP's say that when a UserProperty is added the
> >> >> > item
> >> >> > should be saved , can you safely add many items (like many user
> >> >> > properties)
> >> >> > before actually saving the item?
> >> >> >
> >> >> > 2) I am working on an Outlook addin that works great on my dev
> >> >> > machine
> >> >> > but
> >> >> > appearantly doesn't save/read userproperties for appointment items
> >> >> > but
> >> >> > task
> >> >> > items appearantly read/save fine on most systems.
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
> |
|
| Back to top |
|
 |
Dmitry Streblechenko
Joined: 12 Aug 2007 Posts: 220
|
Posted: Sun Nov 18, 2007 2:02 pm Post subject: Re: More on UserProperties |
|
|
So what exactly happens when you run that code? Do you see an empty property
with the right name but no value in OutlookSpy when you click IMessage?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Steve" wrote in message @microsoft.com...
> Thank you for the reply unfortunately it still doesn't work on all
> machines.
> However the changes didn't break anything on previously working machines.
> First let me apologize for double posting Ken Slovak politely yelled at me
> for also posting in the VSTO newsgroup. Ken my apologies. Dmitry - I
> noticed your app which works perfectly well on several machines I'm
> working
> with for testing uses a different interface. Some sample code also on
> outlookcode.com by Helmut Obertanner that was inspired by yourself that
> doesn't use the Outlook Object Model. Is this another potentially better
> more generic approach?
>
> Thanks
> Steve
>
> "Dmitry Streblechenko" wrote:
>
>> Try the following instead:
>>
>> UserProperty prop = appt.UserProperties.Find(propertyName,Type.Missing);
>> if (prop == null) prop = appt.UserProperties.Add(propertyName,
>> OlUserPropertyType.olText, Type.Missing, Type.Missing);
>> prop.Value = value;
>> appt.Save;
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "Steve" wrote in message
>> @microsoft.com...
>> > Ok here's what I got:
>> >
>> > Microsoft.Office.Interop.Outlook.AppointmentItem appt;
>> > string propertyName = "MyProp";
>> >
>> > // if the property doesn't exist
>> > if(!appt.UserProperties.Find(propertyName,Type.Missing))
>> > {
>> >
>> > appt.UserProperties.Add(propertyName,Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText,
>> > Type.Missing, Type.Missing);
>> > }
>> > appt.UserProperties[propertyName].Value = value;
>> > appt.Save();
>> >
>> > Steve
>> >
>> > "Dmitry Streblechenko" wrote:
>> >
>> >>
>> >> What is your code that sets the propeties and saves the item?
>> >>
>> >> Dmitry Streblechenko (MVP)
>> >> http://www.dimastr.com/
>> >> OutlookSpy - Outlook, CDO
>> >> and MAPI Developer Tool
>> >>
>> >> "Steve" wrote in message
>> >> @microsoft.com...
>> >> > Dmitry
>> >> > Please use my comment for your product OutlookSpy: WOW! It does
>> >> > what
>> >> > it
>> >> > says!
>> >> >
>> >> > As hard as it was to articulate the differences between two systems
>> >> > with
>> >> > your tool I think I may have found something, finally.
>> >> >
>> >> > Dmitry although it does require some explaination - looking at the
>> >> > IMessage
>> >> > GetProps tab I see lots of differences in number of properties with
>> >> > each
>> >> > Appointment item and values. As I suspected my userproperties have
>> >> > no
>> >> > values
>> >> > in the system/version that doesn't work. one property that is
>> >> > interesting
>> >> > is
>> >> > http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/urn:schemas:calendar:version.
>> >> > BTW the value is 2.0. I don't see this one on systems that do work
>> >> > for
>> >> > my
>> >> > Outlook Addin. Do you know what its for?
>> >> > Can you offer an explanation why aren't my properties storing
>> >> > values?
>> >> > Is
>> >> > it
>> >> > possible my properties somehow depend on the property offset?
>> >> >
>> >> > "Dmitry Streblechenko" wrote:
>> >> >
>> >> >> 1.Yes, you can set any number of properties before calling Save
>> >> >> 2. Provide the relevant snippets of your code and indicate what
>> >> >> exactly
>> >> >> does
>> >> >> not work.
>> >> >>
>> >> >> Dmitry Streblechenko (MVP)
>> >> >> http://www.dimastr.com/
>> >> >> OutlookSpy - Outlook, CDO
>> >> >> and MAPI Developer Tool
>> >> >>
>> >> >> "Steve" wrote in message
>> >> >> @microsoft.com...
>> >> >> > 1) I have seen other MVP's say that when a UserProperty is added
>> >> >> > the
>> >> >> > item
>> >> >> > should be saved , can you safely add many items (like many user
>> >> >> > properties)
>> >> >> > before actually saving the item?
>> >> >> >
>> >> >> > 2) I am working on an Outlook addin that works great on my dev
>> >> >> > machine
>> >> >> > but
>> >> >> > appearantly doesn't save/read userproperties for appointment
>> >> >> > items
>> >> >> > but
>> >> >> > task
>> >> >> > items appearantly read/save fine on most systems.
>> >> >> >
>> >> >> >
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>> |
|
| Back to top |
|
 |
Steve
Joined: 12 Aug 2007 Posts: 37
|
Posted: Sun Nov 18, 2007 4:09 pm Post subject: Re: More on UserProperties |
|
|
That's exactly what I see on machines that my addin is running but is unable
to set and retrieve property values on. OutlookSpy shows empty properties
with the right name but no value when I click IMessage. On other machines
my code works great, it sets and retrieves properties using the code you
suggested just as well as it did before with the code I submitted previously.
I have saved the IMessage to text files via OutlookSpy. I can provide them
if you think it would be helpful. Did I say I appreciate the help, I do.
Steve
"Dmitry Streblechenko" wrote:
> So what exactly happens when you run that code? Do you see an empty property
> with the right name but no value in OutlookSpy when you click IMessage?
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "Steve" wrote in message
> @microsoft.com...
> > Thank you for the reply unfortunately it still doesn't work on all
> > machines.
> > However the changes didn't break anything on previously working machines.
> > First let me apologize for double posting Ken Slovak politely yelled at me
> > for also posting in the VSTO newsgroup. Ken my apologies. Dmitry - I
> > noticed your app which works perfectly well on several machines I'm
> > working
> > with for testing uses a different interface. Some sample code also on
> > outlookcode.com by Helmut Obertanner that was inspired by yourself that
> > doesn't use the Outlook Object Model. Is this another potentially better
> > more generic approach?
> >
> > Thanks
> > Steve
> >
> > "Dmitry Streblechenko" wrote:
> >
> >> Try the following instead:
> >>
> >> UserProperty prop = appt.UserProperties.Find(propertyName,Type.Missing);
> >> if (prop == null) prop = appt.UserProperties.Add(propertyName,
> >> OlUserPropertyType.olText, Type.Missing, Type.Missing);
> >> prop.Value = value;
> >> appt.Save;
> >>
> >> Dmitry Streblechenko (MVP)
> >> http://www.dimastr.com/
> >> OutlookSpy - Outlook, CDO
> >> and MAPI Developer Tool
> >>
> >> "Steve" wrote in message
> >> @microsoft.com...
> >> > Ok here's what I got:
> >> >
> >> > Microsoft.Office.Interop.Outlook.AppointmentItem appt;
> >> > string propertyName = "MyProp";
> >> >
> >> > // if the property doesn't exist
> >> > if(!appt.UserProperties.Find(propertyName,Type.Missing))
> >> > {
> >> >
> >> > appt.UserProperties.Add(propertyName,Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText,
> >> > Type.Missing, Type.Missing);
> >> > }
> >> > appt.UserProperties[propertyName].Value = value;
> >> > appt.Save();
> >> >
> >> > Steve
> >> >
> >> > "Dmitry Streblechenko" wrote:
> >> >
> >> >>
> >> >> What is your code that sets the propeties and saves the item?
> >> >>
> >> >> Dmitry Streblechenko (MVP)
> >> >> http://www.dimastr.com/
> >> >> OutlookSpy - Outlook, CDO
> >> >> and MAPI Developer Tool
> >> >>
> >> >> "Steve" wrote in message
> >> >> @microsoft.com...
> >> >> > Dmitry
> >> >> > Please use my comment for your product OutlookSpy: WOW! It does
> >> >> > what
> >> >> > it
> >> >> > says!
> >> >> >
> >> >> > As hard as it was to articulate the differences between two systems
> >> >> > with
> >> >> > your tool I think I may have found something, finally.
> >> >> >
> >> >> > Dmitry although it does require some explaination - looking at the
> >> >> > IMessage
> >> >> > GetProps tab I see lots of differences in number of properties with
> >> >> > each
> >> >> > Appointment item and values. As I suspected my userproperties have
> >> >> > no
> >> >> > values
> >> >> > in the system/version that doesn't work. one property that is
> >> >> > interesting
> >> >> > is
> >> >> > http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/urn:schemas:calendar:version.
> >> >> > BTW the value is 2.0. I don't see this one on systems that do work
> >> >> > for
> >> >> > my
> >> >> > Outlook Addin. Do you know what its for?
> >> >> > Can you offer an explanation why aren't my properties storing
> >> >> > values?
> >> >> > Is
> >> >> > it
> >> >> > possible my properties somehow depend on the property offset?
> >> >> >
> >> >> > "Dmitry Streblechenko" wrote:
> >> >> >
> >> >> >> 1.Yes, you can set any number of properties before calling Save
> >> >> >> 2. Provide the relevant snippets of your code and indicate what
> >> >> >> exactly
> >> >> >> does
> >> >> >> not work.
> >> >> >>
> >> >> >> Dmitry Streblechenko (MVP)
> >> >> >> http://www.dimastr.com/
> >> >> >> OutlookSpy - Outlook, CDO
> >> >> >> and MAPI Developer Tool
> >> >> >>
> >> >> >> "Steve" wrote in message
> >> >> >> @microsoft.com...
> >> >> >> > 1) I have seen other MVP's say that when a UserProperty is added
> >> >> >> > the
> >> >> >> > item
> >> >> >> > should be saved , can you safely add many items (like many user
> >> >> >> > properties)
> >> >> >> > before actually saving the item?
> >> >> >> >
> >> >> >> > 2) I am working on an Outlook addin that works great on my dev
> >> >> >> > machine
> >> >> >> > but
> >> >> >> > appearantly doesn't save/read userproperties for appointment
> >> >> >> > items
> >> >> >> > but
> >> >> >> > task
> >> >> >> > items appearantly read/save fine on most systems.
> >> >> >> >
> >> >> >> >
> >> >> >>
> >> >> >>
> >> >> >>
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
> |
|
| Back to top |
|
 |
Dmitry Streblechenko
Joined: 12 Aug 2007 Posts: 220
|
Posted: Tue Nov 20, 2007 4:23 am Post subject: Re: More on UserProperties |
|
|
Any there anythign special about thee machines where the code does nto work?
Where does tehe item come from? Is it is primary mailbox store, delegated
store, Public Folder, etc?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Steve" wrote in message @microsoft.com...
> That's exactly what I see on machines that my addin is running but is
> unable
> to set and retrieve property values on. OutlookSpy shows empty properties
> with the right name but no value when I click IMessage. On other
> machines
> my code works great, it sets and retrieves properties using the code you
> suggested just as well as it did before with the code I submitted
> previously.
> I have saved the IMessage to text files via OutlookSpy. I can provide
> them
> if you think it would be helpful. Did I say I appreciate the help, I do.
>
> Steve
>
> "Dmitry Streblechenko" wrote:
>
>> So what exactly happens when you run that code? Do you see an empty
>> property
>> with the right name but no value in OutlookSpy when you click IMessage?
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "Steve" wrote in message
>> @microsoft.com...
>> > Thank you for the reply unfortunately it still doesn't work on all
>> > machines.
>> > However the changes didn't break anything on previously working
>> > machines.
>> > First let me apologize for double posting Ken Slovak politely yelled at
>> > me
>> > for also posting in the VSTO newsgroup. Ken my apologies. Dmitry - I
>> > noticed your app which works perfectly well on several machines I'm
>> > working
>> > with for testing uses a different interface. Some sample code also on
>> > outlookcode.com by Helmut Obertanner that was inspired by yourself that
>> > doesn't use the Outlook Object Model. Is this another potentially
>> > better
>> > more generic approach?
>> >
>> > Thanks
>> > Steve
>> >
>> > "Dmitry Streblechenko" wrote:
>> >
>> >> Try the following instead:
>> >>
>> >> UserProperty prop =
>> >> appt.UserProperties.Find(propertyName,Type.Missing);
>> >> if (prop == null) prop = appt.UserProperties.Add(propertyName,
>> >> OlUserPropertyType.olText, Type.Missing, Type.Missing);
>> >> prop.Value = value;
>> >> appt.Save;
>> >>
>> >> Dmitry Streblechenko (MVP)
>> >> http://www.dimastr.com/
>> >> OutlookSpy - Outlook, CDO
>> >> and MAPI Developer Tool
>> >>
>> >> "Steve" wrote in message
>> >> @microsoft.com...
>> >> > Ok here's what I got:
>> >> >
>> >> > Microsoft.Office.Interop.Outlook.AppointmentItem appt;
>> >> > string propertyName = "MyProp";
>> >> >
>> >> > // if the property doesn't exist
>> >> > if(!appt.UserProperties.Find(propertyName,Type.Missing))
>> >> > {
>> >> >
>> >> > appt.UserProperties.Add(propertyName,Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText,
>> >> > Type.Missing, Type.Missing);
>> >> > }
>> >> > appt.UserProperties[propertyName].Value = value;
>> >> > appt.Save();
>> >> >
>> >> > Steve
>> >> >
>> >> > "Dmitry Streblechenko" wrote:
>> >> >
>> >> >>
>> >> >> What is your code that sets the propeties and saves the item?
>> >> >>
>> >> >> Dmitry Streblechenko (MVP)
>> >> >> http://www.dimastr.com/
>> >> >> OutlookSpy - Outlook, CDO
>> >> >> and MAPI Developer Tool
>> >> >>
>> >> >> "Steve" wrote in message
>> >> >> @microsoft.com...
>> >> >> > Dmitry
>> >> >> > Please use my comment for your product OutlookSpy: WOW! It
>> >> >> > does
>> >> >> > what
>> >> >> > it
>> >> >> > says!
>> >> >> >
>> >> >> > As hard as it was to articulate the differences between two
>> >> >> > systems
>> >> >> > with
>> >> >> > your tool I think I may have found something, finally.
>> >> >> >
>> >> >> > Dmitry although it does require some explaination - looking at
>> >> >> > the
>> >> >> > IMessage
>> >> >> > GetProps tab I see lots of differences in number of properties
>> >> >> > with
>> >> >> > each
>> >> >> > Appointment item and values. As I suspected my userproperties
>> >> >> > have
>> >> >> > no
>> >> >> > values
>> >> >> > in the system/version that doesn't work. one property that is
>> >> >> > interesting
>> >> >> > is
>> >> >> > http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/urn:schemas:calendar:version.
>> >> >> > BTW the value is 2.0. I don't see this one on systems that do
>> >> >> > work
>> >> >> > for
>> >> >> > my
>> >> >> > Outlook Addin. Do you know what its for?
>> >> >> > Can you offer an explanation why aren't my properties storing
>> >> >> > values?
>> >> >> > Is
>> >> >> > it
>> >> >> > possible my properties somehow depend on the property offset?
>> >> >> >
>> >> >> > "Dmitry Streblechenko" wrote:
>> >> >> >
>> >> >> >> 1.Yes, you can set any number of properties before calling Save
>> >> >> >> 2. Provide the relevant snippets of your code and indicate what
>> >> >> >> exactly
>> >> >> >> does
>> >> >> >> not work.
>> >> >> >>
>> >> >> >> Dmitry Streblechenko (MVP)
>> >> >> >> http://www.dimastr.com/
>> >> >> >> OutlookSpy - Outlook, CDO
>> >> >> >> and MAPI Developer Tool
>> >> >> >>
>> >> >> >> "Steve" wrote in message
>> >> >> >> @microsoft.com...
>> >> >> >> > 1) I have seen other MVP's say that when a UserProperty is
>> >> >> >> > added
>> >> >> >> > the
>> >> >> >> > item
>> >> >> >> > should be saved , can you safely add many items (like many
>> >> >> >> > user
>> >> >> >> > properties)
>> >> >> >> > before actually saving the item?
>> >> >> >> >
>> >> >> >> > 2) I am working on an Outlook addin that works great on my dev
>> >> >> >> > machine
>> >> >> >> > but
>> >> >> >> > appearantly doesn't save/read userproperties for appointment
>> >> >> >> > items
>> >> >> >> > but
>> >> >> >> > task
>> >> >> >> > items appearantly read/save fine on most systems.
>> >> >> >> >
>> >> >> >> >
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>> |
|
| Back to top |
|
 |
Steve
Joined: 12 Aug 2007 Posts: 37
|
Posted: Tue Nov 20, 2007 10:14 am Post subject: Re: More on UserProperties |
|
|
There is nothing special about the machines where the get/set property
methods not appearantly work. The items are in the primary mailbox store
under the calendar folder these are appointment items. My app also works
with task items in the primary mailbox store. The get/set methods of the OOM
appearantly work on task items even when the same code fails on calendar
items. The machines are just running patched up-to-date XP with Office 2k3
Professional sp3. Outlook is running in an exchange env with Exchange Server
2k3. My test env involves my physical notebook running the same as above and
a development vm running Server 2k3 patched with Office 2k3 Pro sp3 and
vs.net 2003 with install shield. Outlook in the vm is also running connected
to exchange 2k3. This is why I don't understand the differences in the
number of properties for each calendar item between machines.
"Dmitry Streblechenko" wrote:
> Any there anythign special about thee machines where the code does nto work?
> Where does tehe item come from? Is it is primary mailbox store, delegated
> store, Public Folder, etc?
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "Steve" wrote in message
> @microsoft.com...
> > That's exactly what I see on machines that my addin is running but is
> > unable
> > to set and retrieve property values on. OutlookSpy shows empty properties
> > with the right name but no value when I click IMessage. On other
> > machines
> > my code works great, it sets and retrieves properties using the code you
> > suggested just as well as it did before with the code I submitted
> > previously.
> > I have saved the IMessage to text files via OutlookSpy. I can provide
> > them
> > if you think it would be helpful. Did I say I appreciate the help, I do.
> >
> > Steve
> >
> > "Dmitry Streblechenko" wrote:
> >
> >> So what exactly happens when you run that code? Do you see an empty
> >> property
> >> with the right name but no value in OutlookSpy when you click IMessage?
> >>
> >> Dmitry Streblechenko (MVP)
> >> http://www.dimastr.com/
> >> OutlookSpy - Outlook, CDO
> >> and MAPI Developer Tool
> >>
> >> "Steve" wrote in message
> >> @microsoft.com...
> >> > Thank you for the reply unfortunately it still doesn't work on all
> >> > machines.
> >> > However the changes didn't break anything on previously working
> >> > machines.
> >> > First let me apologize for double posting Ken Slovak politely yelled at
> >> > me
> >> > for also posting in the VSTO newsgroup. Ken my apologies. Dmitry - I
> >> > noticed your app which works perfectly well on several machines I'm
> >> > working
> >> > with for testing uses a different interface. Some sample code also on
> >> > outlookcode.com by Helmut Obertanner that was inspired by yourself that
> >> > doesn't use the Outlook Object Model. Is this another potentially
> >> > better
> >> > more generic approach?
> >> >
> >> > Thanks
> >> > Steve
> >> >
> >> > "Dmitry Streblechenko" wrote:
> >> >
> >> >> Try the following instead:
> >> >>
> >> >> UserProperty prop =
> >> >> appt.UserProperties.Find(propertyName,Type.Missing);
> >> >> if (prop == null) prop = appt.UserProperties.Add(propertyName,
> >> >> OlUserPropertyType.olText, Type.Missing, Type.Missing);
> >> >> prop.Value = value;
> >> >> appt.Save;
> >> >>
> >> >> Dmitry Streblechenko (MVP)
> >> >> http://www.dimastr.com/
> >> >> OutlookSpy - Outlook, CDO
> >> >> and MAPI Developer Tool
> >> >>
> >> >> "Steve" wrote in message
> >> >> @microsoft.com...
> >> >> > Ok here's what I got:
> >> >> >
> >> >> > Microsoft.Office.Interop.Outlook.AppointmentItem appt;
> >> >> > string propertyName = "MyProp";
> >> >> >
> >> >> > // if the property doesn't exist
> >> >> > if(!appt.UserProperties.Find(propertyName,Type.Missing))
> >> >> > {
> >> >> >
> >> >> > appt.UserProperties.Add(propertyName,Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText,
> >> >> > Type.Missing, Type.Missing);
> >> >> > }
> >> >> > appt.UserProperties[propertyName].Value = value;
> >> >> > appt.Save();
> >> >> >
> >> >> > Steve
> >> >> >
> >> >> > "Dmitry Streblechenko" wrote:
> >> >> >
> >> >> >>
> >> >> >> What is your code that sets the propeties and saves the item?
> >> >> >>
> >> >> >> Dmitry Streblechenko (MVP)
> >> >> >> http://www.dimastr.com/
> >> >> >> OutlookSpy - Outlook, CDO
> >> >> >> and MAPI Developer Tool
> >> >> >>
> >> >> >> "Steve" wrote in message
> >> >> >> @microsoft.com...
> >> >> >> > Dmitry
> >> >> >> > Please use my comment for your product OutlookSpy: WOW! It
> >> >> >> > does
> >> >> >> > what
> >> >> >> > it
> >> >> >> > says!
> >> >> >> >
> >> >> >> > As hard as it was to articulate the differences between two
> >> >> >> > systems
> >> >> >> > with
> >> >> >> > your tool I think I may have found something, finally.
> >> >> >> >
> >> >> >> > Dmitry although it does require some explaination - looking at
> >> >> >> > the
> >> >> >> > IMessage
> >> >> >> > GetProps tab I see lots of differences in number of properties
> >> >> >> > with
> >> >> >> > each
> >> >> >> > Appointment item and values. As I suspected my userproperties
> >> >> >> > have
> >> >> >> > no
> >> >> >> > values
> >> >> >> > in the system/version that doesn't work. one property that is
> >> >> >> > interesting
> >> >> >> > is
> >> >> >> > http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/urn:schemas:calendar:version.
> >> >> >> > BTW the value is 2.0. I don't see this one on systems that do
> >> >> >> > work
> >> >> >> > for
> >> >> >> > my
> >> >> >> > Outlook Addin. Do you know what its for?
> >> >> >> > Can you offer an explanation why aren't my properties storing
> >> >> >> > values?
> >> >> >> > Is
> >> >> >> > it
> >> >> >> > possible my properties somehow depend on the property offset?
> >> >> >> >
> >> >> >> > "Dmitry Streblechenko" wrote:
> >> >> >> >
> >> >> >> >> 1.Yes, you can set any number of properties before calling Save
> >> >> >> >> 2. Provide the relevant snippets of your code and indicate what
> >> >> >> >> exactly
> >> >> >> >> does
> >> >> >> >> not work.
> >> >> >> >>
> >> >> >> >> Dmitry Streblechenko (MVP)
> >> >> >> >> http://www.dimastr.com/
> >> >> >> >> OutlookSpy - Outlook, CDO
> >> >> >> >> and MAPI Developer Tool
> >> >> >> >>
> >> >> >> >> "Steve" wrote in message
> >> >> >> >> @microsoft.com...
> >> >> >> >> > 1) I have seen other MVP's say that when a UserProperty is
> >> >> >> >> > added
> >> >> >> >> > the
> >> >> >> >> > item
> >> >> >> >> > should be saved , can you safely add many items (like many
> >> >> >> >> > user
> >> >> >> >> > properties)
> >> >> >> >> > before actually saving the item?
> >> >> >> >> >
> >> >> >> >> > 2) I am working on an Outlook addin that works great on my dev
> >> >> >> >> > machine
> >> >> >> >> > but
> >> >> >> >> > appearantly doesn't save/read userproperties for appointment
> >> >> >> >> > items
> >> >> >> >> > but
> >> >> >> >> > task
> >> >> >> >> > items appearantly read/save fine on most systems.
> >> >> >> >> >
> >> >> >> >> >
> >> >> >> >>
> >> >> >> >>
> >> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
> |
|
| Back to top |
|
 |
Dmitry Streblechenko
Joined: 12 Aug 2007 Posts: 220
|
Posted: Tue Nov 20, 2007 3:54 pm Post subject: Re: More on UserProperties |
|
|
Can you edit these properties form OutlookSpy?
Can you run the following code from OutlookSpy (click Script Editor button
when the item in question is selected)?
set Item = Application.ActiveExplorer.Selection(1)
set prop = Item.UserProperties.Find("test")
if (prop Is Nothing) Then
set prop = Item.UserProperties.Add("test", olText)
End If
prop.Value = "whatever"
Item.Save
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Steve" wrote in message @microsoft.com...
> There is nothing special about the machines where the get/set property
> methods not appearantly work. The items are in the primary mailbox store
> under the calendar folder these are appointment items. My app also works
> with task items in the primary mailbox store. The get/set methods of the
> OOM
> appearantly work on task items even when the same code fails on calendar
> items. The machines are just running patched up-to-date XP with Office
> 2k3
> Professional sp3. Outlook is running in an exchange env with Exchange
> Server
> 2k3. My test env involves my physical notebook running the same as above
> and
> a development vm running Server 2k3 patched with Office 2k3 Pro sp3 and
> vs.net 2003 with install shield. Outlook in the vm is also running
> connected
> to exchange 2k3. This is why I don't understand the differences in the
> number of properties for each calendar item between machines.
>
> "Dmitry Streblechenko" wrote:
>
>> Any there anythign special about thee machines where the code does nto
>> work?
>> Where does tehe item come from? Is it is primary mailbox store, delegated
>> store, Public Folder, etc?
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "Steve" wrote in message
>> @microsoft.com...
>> > That's exactly what I see on machines that my addin is running but is
>> > unable
>> > to set and retrieve property values on. OutlookSpy shows empty
>> > properties
>> > with the right name but no value when I click IMessage. On other
>> > machines
>> > my code works great, it sets and retrieves properties using the code
>> > you
>> > suggested just as well as it did before with the code I submitted
>> > previously.
>> > I have saved the IMessage to text files via OutlookSpy. I can provide
>> > them
>> > if you think it would be helpful. Did I say I appreciate the help, I
>> > do.
>> >
>> > Steve
>> >
>> > "Dmitry Streblechenko" wrote:
>> >
>> >> So what exactly happens when you run that code? Do you see an empty
>> >> property
>> >> with the right name but no value in OutlookSpy when you click
>> >> IMessage?
>> >>
>> >> Dmitry Streblechenko (MVP)
>> >> http://www.dimastr.com/
>> >> OutlookSpy - Outlook, CDO
>> >> and MAPI Developer Tool
>> >>
>> >> "Steve" wrote in message
>> >> @microsoft.com...
>> >> > Thank you for the reply unfortunately it still doesn't work on all
>> >> > machines.
>> >> > However the changes didn't break anything on previously working
>> >> > machines.
>> >> > First let me apologize for double posting Ken Slovak politely yelled
>> >> > at
>> >> > me
>> >> > for also posting in the VSTO newsgroup. Ken my apologies. Dmitry -
>> >> > I
>> >> > noticed your app which works perfectly well on several machines I'm
>> >> > working
>> >> > with for testing uses a different interface. Some sample code also
>> >> > on
>> >> > outlookcode.com by Helmut Obertanner that was inspired by yourself
>> >> > that
>> >> > doesn't use the Outlook Object Model. Is this another potentially
>> >> > better
>> >> > more generic approach?
>> >> >
>> >> > Thanks
>> >> > Steve
>> >> >
>> >> > "Dmitry Streblechenko" wrote:
>> >> >
>> >> >> Try the following instead:
>> >> >>
>> >> >> UserProperty prop =
>> >> >> appt.UserProperties.Find(propertyName,Type.Missing);
>> >> >> if (prop == null) prop = appt.UserProperties.Add(propertyName,
>> >> >> OlUserPropertyType.olText, Type.Missing, Type.Missing);
>> >> >> prop.Value = value;
>> >> >> appt.Save;
>> >> >>
>> >> >> Dmitry Streblechenko (MVP)
>> >> >> http://www.dimastr.com/
>> >> >> OutlookSpy - Outlook, CDO
>> >> >> and MAPI Developer Tool
>> >> >>
>> >> >> "Steve" wrote in message
>> >> >> @microsoft.com...
>> >> >> > Ok here's what I got:
>> >> >> >
>> >> >> > Microsoft.Office.Interop.Outlook.AppointmentItem appt;
>> >> >> > string propertyName = "MyProp";
>> >> >> >
>> >> >> > // if the property doesn't exist
>> >> >> > if(!appt.UserProperties.Find(propertyName,Type.Missing))
>> >> >> > {
>> >> >> >
>> >> >> > appt.UserProperties.Add(propertyName,Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText,
>> >> >> > Type.Missing, Type.Missing);
>> >> >> > }
>> >> >> > appt.UserProperties[propertyName].Value = value;
>> >> >> > appt.Save();
>> >> >> >
>> >> >> > Steve
>> >> >> >
>> >> >> > "Dmitry Streblechenko" wrote:
>> >> >> >
>> >> >> >>
>> >> >> >> What is your code that sets the propeties and saves the item?
>> >> >> >>
>> >> >> >> Dmitry Streblechenko (MVP)
>> >> >> >> http://www.dimastr.com/
>> >> >> >> OutlookSpy - Outlook, CDO
>> >> >> >> and MAPI Developer Tool
>> >> >> >>
>> >> >> >> "Steve" wrote in message
>> >> >> >> @microsoft.com...
>> >> >> >> > Dmitry
>> >> >> >> > Please use my comment for your product OutlookSpy: WOW! It
>> >> >> >> > does
>> >> >> >> > what
>> >> >> >> > it
>> >> >> >> > says!
>> >> >> >> >
>> >> >> >> > As hard as it was to articulate the differences between two
>> >> >> >> > systems
>> >> >> >> > with
>> >> >> >> > your tool I think I may have found something, finally.
>> >> >> >> >
>> >> >> >> > Dmitry although it does require some explaination - looking at
>> >> >> >> > the
>> >> >> >> > IMessage
>> >> >> >> > GetProps tab I see lots of differences in number of properties
>> >> >> >> > with
>> >> >> >> > each
>> >> >> >> > Appointment item and values. As I suspected my userproperties
>> >> >> >> > have
>> >> >> >> > no
>> >> >> >> > values
>> >> >> >> > in the system/version that doesn't work. one property that is
>> >> >> >> > interesting
>> >> >> >> > is
>> >> >> >> > http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/urn:schemas:calendar:version.
>> >> >> >> > BTW the value is 2.0. I don't see this one on systems that do
>> >> >> >> > work
>> >> >> >> > for
>> >> >> >> > my
>> >> >> >> > Outlook Addin. Do you know what its for?
>> >> >> >> > Can you offer an explanation why aren't my properties storing
>> >> >> >> > values?
>> >> >> >> > Is
>> >> >> >> > it
>> >> >> >> > possible my properties somehow depend on the property offset?
>> >> >> >> >
>> >> >> >> > "Dmitry Streblechenko" wrote:
>> >> >> >> >
>> >> >> >> >> 1.Yes, you can set any number of properties before calling
>> >> >> >> >> Save
>> >> >> >> >> 2. Provide the relevant snippets of your code and indicate
>> >> >> >> >> what
>> >> >> >> >> exactly
>> >> >> >> >> does
>> >> >> >> >> not work.
>> >> >> >> >>
>> >> >> >> >> Dmitry Streblechenko (MVP)
>> >> >> >> >> http://www.dimastr.com/
>> >> >> >> >> OutlookSpy - Outlook, CDO
>> >> >> >> >> and MAPI Developer Tool
>> >> >> >> >>
>> >> >> >> >> "Steve" wrote in message
>> >> >> >> >> @microsoft.com...
>> >> >> >> >> > 1) I have seen other MVP's say that when a UserProperty is
>> >> >> >> >> > added
>> >> >> >> >> > the
>> >> >> >> >> > item
>> >> >> >> >> > should be saved , can you safely add many items (like many
>> >> >> >> >> > user
>> >> >> >> >> > properties)
>> >> >> >> >> > before actually saving the item?
>> >> >> >> >> >
>> >> >> >> >> > 2) I am working on an Outlook addin that works great on my
>> >> >> >> >> > dev
>> >> >> >> >> > machine
>> >> >> >> >> > but
>> >> >> >> >> > appearantly doesn't save/read userproperties for
>> >> >> >> >> > appointment
>> >> >> >> >> > items
>> >> >> >> >> > but
>> >> >> >> >> > task
>> >> >> >> >> > items appearantly read/save fine on most systems.
>> >> >> >> >> >
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >> >>
>> >> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>> |
|
| Back to top |
|
 |
Steve
Joined: 12 Aug 2007 Posts: 37
|
Posted: Tue Nov 20, 2007 3:06 pm Post subject: Re: More on UserProperties |
|
|
Yes. And the script works just fine. I viewed the IMessage afterwards and
the property test is there with its value of whatever
"Dmitry Streblechenko" wrote:
> Can you edit these properties form OutlookSpy?
> Can you run the following code from OutlookSpy (click Script Editor button
> when the item in question is selected)?
>
> set Item = Application.ActiveExplorer.Selection(1)
> set prop = Item.UserProperties.Find("test")
> if (prop Is Nothing) Then
> set prop = Item.UserProperties.Add("test", olText)
> End If
> prop.Value = "whatever"
> Item.Save
>
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "Steve" wrote in message
> @microsoft.com...
> > There is nothing special about the machines where the get/set property
> > methods not appearantly work. The items are in the primary mailbox store
> > under the calendar folder these are appointment items. My app also works
> > with task items in the primary mailbox store. The get/set methods of the
> > OOM
> > appearantly work on task items even when the same code fails on calendar
> > items. The machines are just running patched up-to-date XP with Office
> > 2k3
> > Professional sp3. Outlook is running in an exchange env with Exchange
> > Server
> > 2k3. My test env involves my physical notebook running the same as above
> > and
> > a development vm running Server 2k3 patched with Office 2k3 Pro sp3 and
> > vs.net 2003 with install shield. Outlook in the vm is also running
> > connected
> > to exchange 2k3. This is why I don't understand the differences in the
> > number of properties for each calendar item between machines.
> >
> > "Dmitry Streblechenko" wrote:
> >
> >> Any there anythign special about thee machines where the code does nto
> >> work?
> >> Where does tehe item come from? Is it is primary mailbox store, delegated
> >> store, Public Folder, etc?
> >>
> >> Dmitry Streblechenko (MVP)
> >> http://www.dimastr.com/
> >> OutlookSpy - Outlook, CDO
> >> and MAPI Developer Tool
> >>
> >> "Steve" wrote in message
> >> @microsoft.com...
> >> > That's exactly what I see on machines that my addin is running but is
> >> > unable
> >> > to set and retrieve property values on. OutlookSpy shows empty
> >> > properties
> >> > with the right name but no value when I click IMessage. On other
> >> > machines
> >> > my code works great, it sets and retrieves properties using the code
> >> > you
> >> > suggested just as well as it did before with the code I submitted
> >> > previously.
> >> > I have saved the IMessage to text files via OutlookSpy. I can provide
> >> > them
> >> > if you think it would be helpful. Did I say I appreciate the help, I
> >> > do.
> >> >
> >> > Steve
> >> >
> >> > "Dmitry Streblechenko" wrote:
> >> >
> >> >> So what exactly happens when you run that code? Do you see an empty
> >> >> property
> >> >> with the right name but no value in OutlookSpy when you click
> >> >> IMessage?
> >> >>
> >> >> Dmitry Streblechenko (MVP)
> >> >> http://www.dimastr.com/
> >> >> OutlookSpy - Outlook, CDO
> >> >> and MAPI Developer Tool
> >> >>
> >> >> "Steve" wrote in message
> >> >> @microsoft.com...
> >> >> > Thank you for the reply unfortunately it still doesn't work on all
> >> >> > machines.
> >> >> > However the changes didn't break anything on previously working
> >> >> > machines.
> >> >> > First let me apologize for double posting Ken Slovak politely yelled
> >> >> > at
> >> >> > me
> >> >> > for also posting in the VSTO newsgroup. Ken my apologies. Dmitry -
> >> >> > I
> >> >> > noticed your app which works perfectly well on several machines I'm
> >> >> > working
> >> >> > with for testing uses a different interface. Some sample code also
> >> >> > on
> >> >> > outlookcode.com by Helmut Obertanner that was inspired by yourself
> >> >> > that
> >> >> > doesn't use the Outlook Object Model. Is this another potentially
> >> >> > better
> >> >> > more generic approach?
> >> >> >
> >> >> > Thanks
> >> >> > Steve
> >> >> >
> >> >> > "Dmitry Streblechenko" wrote:
> >> >> >
> >> >> >> Try the following instead:
> >> >> >>
> >> >> >> UserProperty prop =
> >> >> >> appt.UserProperties.Find(propertyName,Type.Missing);
> >> >> >> if (prop == null) prop = appt.UserProperties.Add(propertyName,
> >> >> >> OlUserPropertyType.olText, Type.Missing, Type.Missing);
> >> >> >> prop.Value = value;
> >> >> >> appt.Save;
> >> >> >>
> >> >> >> Dmitry Streblechenko (MVP)
> >> >> >> http://www.dimastr.com/
> >> >> >> OutlookSpy - Outlook, CDO
> >> >> >> and MAPI Developer Tool
> >> >> >>
> >> >> >> "Steve" wrote in message
> >> >> >> @microsoft.com...
> >> >> >> > Ok here's what I got:
> >> >> >> >
> >> >> >> > Microsoft.Office.Interop.Outlook.AppointmentItem appt;
> >> >> >> > string propertyName = "MyProp";
> >> >> >> >
> >> >> >> > // if the property doesn't exist
> >> >> >> > if(!appt.UserProperties.Find(propertyName,Type.Missing))
> >> >> >> > {
> >> >> >> >
> >> >> >> > appt.UserProperties.Add(propertyName,Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText,
> >> >> >> > Type.Missing, Type.Missing);
> >> >> >> > }
> >> >> >> > appt.UserProperties[propertyName].Value = value;
> >> >> >> > appt.Save();
> >> >> >> >
> >> >> >> > Steve
> >> >> >> >
> >> >> >> > "Dmitry Streblechenko" wrote:
> >> >> >> >
> >> >> >> >>
> >> >> >> >> What is your code that sets the propeties and saves the item?
> >> >> >> >>
> >> >> >> >> Dmitry Streblechenko (MVP)
> >> >> >> >> http://www.dimastr.com/
> >> >> >> >> OutlookSpy - Outlook, CDO
> >> >> >> >> and MAPI Developer Tool
> >> >> >> >>
> >> >> >> >> "Steve" wrote in message
> >> >> >> >> @microsoft.com...
> >> >> >> >> > Dmitry
> >> >> >> >> > Please use my comment for your product OutlookSpy: WOW! It
> >> >> >> >> > does
> >> >> >> >> > what
> >> >> >> >> > it
> >> >> >> >> > says!
> >> >> >> >> >
> >> >> >> >> > As hard as it was to articulate the differences between two
> >> >> >> >> > systems
> >> >> >> >> > with
> >> >> >> >> > your tool I think I may have found something, finally.
> >> >> >> >> >
> >> >> >> >> > Dmitry although it does require some explaination - looking at
> >> >> >> >> > the
> >> >> >> >> > IMessage
> >> >> >> >> > GetProps tab I see lots of differences in number of properties
> >> >> >> >> > with
> >> >> >> >> > each
> >> >> >> >> > Appointment item and values. As I suspected my userproperties
> >> >> >> >> > have
> >> >> >> >> > no
> >> >> >> >> > values
> >> >> >> >> > in the system/version that doesn't work. one property that is
> >> >> >> >> > interesting
> >> >> >> >> > is
> >> >> >> >> > http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/urn:schemas:calendar:version.
> >> >> >> >> > BTW the value is 2.0. I don't see this one on systems that do
> >> >> >> >> > work
> >> >> >> >> > for
> >> >> >> >> > my
> >> >> >> >> > Outlook Addin. Do you know what its for?
> >> >> >> >> > Can you offer an explanation why aren't my properties storing
> >> >> >> >> > values?
> >> >> >> >> > Is
> >> >> >> >> > it
> >> >> >> >> > possible my properties somehow depend on the property offset?
> >> >> >> >> >
> >> >> >> >> > "Dmitry Streblechenko" wrote:
> >> >> >> >> >
> >> >> >> >> >> 1.Yes, you can set any number of properties before calling
> >> >> >> >> >> Save
> >> >> >> >> >> 2. Provide the relevant snippets of your code and indicate
> >> >> >> >> >> what
> >> >> >> >> >> exactly
> >> >> >> >> >> does
> >> >> >> >> >> not work.
> >> >> >> >> >>
> >> >> >> >> >> Dmitry Streblechenko (MVP)
> >> >> >> >> >> http://www.dimastr.com/
> >> >> >> >> >> OutlookSpy - Outlook, CDO
> >> >> >> >> >> and MAPI Developer Tool
> >> >> >> >> >>
> >> >> >> >> >> "Steve" wrote in message
> >> >> >> >> >> @microsoft.com...
> >> >> >> >> >> > 1) I have seen other MVP's say that when a UserProperty is
> >> >> >> >> >> > added
> >> >> >> >> >> > the
> >> >> >> >> >> > item
> >> >> >> >> >> > should be saved , can you safely add many items (like many
> >> >> >> >> >> > user
> >> >> >> >> >> > properties)
> >> >> >> >> >> > before actually saving the item?
> >> >> >> >> >> >
> >> >> >> >> >> > 2) I am working on an Outlook addin that works great on my
> >> >> >> >> >> > dev
> >> >> >> >> >> > machine
> >> >> >> >> >> > but
> >> >> >> >> >> > appearantly doesn't save/read userproperties for
> >> >> >> >> >> > appointment
> >> >> >> >> >> > items
> >> >> >> >> >> > but
> >> >> >> >> >> > task
> >> >> >> >> >> > items appearantly read/save fine on most systems.
> >> >> >> >> >> >
> >> >> >> >> >> >
> >> >> >> >> >>
> >> >> >> >> >>
> >> >> >> >> >>
> >> >> >> >>
> >> >> >> >>
> >> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
> |
|
| Back to top |
|
 |
Steve
Joined: 12 Aug 2007 Posts: 37
|
Posted: Tue Nov 20, 2007 8:12 pm Post subject: Re: More on UserProperties |
|
|
I just realized an oddity on the test machine: Office Communicator 2007 is
installed with Live Communication Server 2007. So I thought I would perform
a detect and repair for the heck of it removing all customization returning
to default settings... It resolved the get/set property problem using the
OOM. But this doesn't explain why. Undoubtly I will have to supoprt systems
without modification. I assume I'll have to use MAPI or extended MAPI in a
mixed 2003/2007 env.
Thoughts?
"Dmitry Streblechenko" wrote:
> Can you edit these properties form OutlookSpy?
> Can you run the following code from OutlookSpy (click Script Editor button
> when the item in question is selected)?
>
> set Item = Application.ActiveExplorer.Selection(1)
> set prop = Item.UserProperties.Find("test")
> if (prop Is Nothing) Then
> set prop = Item.UserProperties.Add("test", olText)
> End If
> prop.Value = "whatever"
> Item.Save
>
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "Steve" wrote in message
> @microsoft.com...
> > There is nothing special about the machines where the get/set property
> > methods not appearantly work. The items are in the primary mailbox store
> > under the calendar folder these are appointment items. My app also works
> > with task items in the primary mailbox store. The get/set methods of the
> > OOM
> > appearantly work on task items even when the same code fails on calendar
> > items. The machines are just running patched up-to-date XP with Office
> > 2k3
> > Professional sp3. Outlook is running in an exchange env with Exchange
> > Server
> > 2k3. My test env involves my physical notebook running the same as above
> > and
> > a development vm running Server 2k3 patched with Office 2k3 Pro sp3 and
> > vs.net 2003 with install shield. Outlook in the vm is also running
> > connected
> > to exchange 2k3. This is why I don't understand the differences in the
> > number of properties for each calendar item between machines.
> >
> > "Dmitry Streblechenko" wrote:
> >
> >> Any there anythign special about thee machines where the code does nto
> >> work?
> >> Where does tehe item come from? Is it is primary mailbox store, delegated
> >> store, Public Folder, etc?
> >>
> >> Dmitry Streblechenko (MVP)
> >> http://www.dimastr.com/
> >> OutlookSpy - Outlook, CDO
> >> and MAPI Developer Tool
> >>
> >> "Steve" wrote in message
> >> @microsoft.com...
> >> > That's exactly what I see on machines that my addin is running but is
> >> > unable
> >> > to set and retrieve property values on. OutlookSpy shows empty
> >> > properties
> >> > with the right name but no value when I click IMessage. On other
> >> > machines
> >> > my code works great, it sets and retrieves properties using the code
> >> > you
> >> > suggested just as well as it did before with the code I submitted
> >> > previously.
> >> > I have saved the IMessage to text files via OutlookSpy. I can provide
> >> > them
> >> > if you think it would be helpful. Did I say I appreciate the help, I
> >> > do.
> >> >
> >> > Steve
> >> >
> >> > "Dmitry Streblechenko" wrote:
> >> >
> >> >> So what exactly happens when you run that code? Do you see an empty
> >> >> property
> >> >> with the right name but no value in OutlookSpy when you click
> >> >> IMessage?
> >> >>
> >> >> Dmitry Streblechenko (MVP)
> >> >> http://www.dimastr.com/
> >> >> OutlookSpy - Outlook, CDO
> >> >> and MAPI Developer Tool
> >> >>
> >> >> "Steve" wrote in message
> >> >> @microsoft.com...
> >> >> > Thank you for the reply unfortunately it still doesn't work on all
> >> >> > machines.
> >> >> > However the changes didn't break anything on previously working
> >> >> > machines.
> >> >> > First let me apologize for double posting Ken Slovak politely yelled
> >> >> > at
> >> >> > me
> >> >> > for also posting in the VSTO newsgroup. Ken my apologies. Dmitry -
> >> >> > I
> >> >> > noticed your app which works perfectly well on several machines I'm
> >> >> > working
> >> >> > with for testing uses a different interface. Some sample code also
> >> >> > on
> >> >> > outlookcode.com by Helmut Obertanner that was inspired by yourself
> >> >> > that
> >> >> > doesn't use the Outlook Object Model. Is this another potentially
> >> >> > better
> >> >> > more generic approach?
> >> >> >
> >> >> > Thanks
> >> >> > Steve
> >> >> >
> >> >> > "Dmitry Streblechenko" wrote:
> >> >> >
> >> >> >> Try the following instead:
> >> >> >>
> >> >> >> UserProperty prop =
> >> >> >> appt.UserProperties.Find(propertyName,Type.Missing);
> >> >> >> if (prop == null) prop = appt.UserProperties.Add(propertyName,
> >> >> >> OlUserPropertyType.olText, Type.Missing, Type.Missing);
> >> >> >> prop.Value = value;
> >> >> >> appt.Save;
> >> >> >>
> >> >> >> Dmitry Streblechenko (MVP)
> >> >> >> http://www.dimastr.com/
> >> >> >> OutlookSpy - Outlook, CDO
> >> >> >> and MAPI Developer Tool
> >> >> >>
> >> >> >> "Steve" wrote in message
> >> >> >> @microsoft.com...
> >> >> >> > Ok here's what I got:
> >> >> >> >
> >> >> >> > Microsoft.Office.Interop.Outlook.AppointmentItem appt;
> >> >> >> > string propertyName = "MyProp";
> >> >> >> >
> >> >> >> > // if the property doesn't exist
> >> >> >> > if(!appt.UserProperties.Find(propertyName,Type.Missing))
> >> >> >> > {
> >> >> >> >
> >> >> >> > appt.UserProperties.Add(propertyName,Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText,
> >> >> >> > Type.Missing, Type.Missing);
> >> >> >> > }
> >> >> >> > appt.UserProperties[propertyName].Value = value;
> >> >> >> > appt.Save();
> >> >> >> >
> >> >> >> > Steve
> >> >> >> >
> >> >> >> > "Dmitry Streblechenko" wrote:
> >> >> >> >
> >> >> >> >>
> >> >> >> >> What is your code that sets the propeties and saves the item?
> >> >> >> >>
> >> >> >> >> Dmitry Streblechenko (MVP)
> >> >> >> >> http://www.dimastr.com/
> >> >> >> >> OutlookSpy - Outlook, CDO
> >> >> >> >> and MAPI Developer Tool
> >> >> >> >>
> >> >> >> >> "Steve" wrote in message
> >> >> >> >> @microsoft.com...
> >> >> >> >> > Dmitry
> >> >> >> >> > Please use my comment for your product OutlookSpy: WOW! It
> >> >> >> >> > does
> >> >> >> >> > what
> >> >> >> >> > it
> >> >> >> >> > says!
> >> >> >> >> >
> >> >> >> >> > As hard as it was to articulate the differences between two
> >> >> >> >> > systems
> >> >> >> >> > with
> >> >> >> >> > your tool I think I may have found something, finally.
> >> >> >> >> >
> >> >> >> >> > Dmitry although it does require some explaination - looking at
> >> >> >> >> > the
> >> >> >> >> > IMessage
> >> >> >> >> > GetProps tab I see lots of differences in number of properties
> >> >> >> >> > with
> >> >> >> >> > each
> >> >> >> >> > Appointment item and values. As I suspected my userproperties
> >> >> >> >> > have
> >> >> >> >> > no
> >> >> >> >> > values
> >> >> >> >> > in the system/version that doesn't work. one property that is
> >> >> >> >> > interesting
> >> >> >> >> > is
> >> >> >> >> > http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/urn:schemas:calendar:version.
> >> >> >> >> > BTW the value is 2.0. I don't see this one on systems that do
> >> >> >> >> > work
> >> >> >> >> > for
> >> >> >> >> > my
> >> >> >> >> > Outlook Addin. Do you know what its for?
> >> >> >> >> > Can you offer an explanation why aren't my properties storing
> >> >> >> >> > values?
> >> >> >> >> > Is
> >> >> >> >> > it
> >> >> >> >> > possible my properties somehow depend on the property offset?
> >> >> >> >> >
> >> >> >> >> > "Dmitry Streblechenko" wrote:
> >> >> >> >> >
> >> >> >> >> >> 1.Yes, you can set any number of properties before calling
> >> >> >> >> >> Save
> >> >> >> >> >> 2. Provide the relevant snippets of your code and indicate
> >> >> >> >> >> what
> >> >> >> >> >> exactly
> >> >> >> >> >> does
> >> >> >> >> >> not work.
> >> >> >> >> >>
> >> >> >> >> >> Dmitry Streblechenko (MVP)
> >> >> >> >> >> http://www.dimastr.com/
> >> >> >> >> >> OutlookSpy - Outlook, CDO
> >> >> >> >> >> and MAPI Developer Tool
> >> >> >> >> >>
> >> >> >> >> >> "Steve" wrote in message
> >> >> >> >> >> @microsoft.com...
> >> >> >> >> >> > 1) I have seen other MVP's say that when a UserProperty is
> >> >> >> >> >> > added
> >> >> >> >> >> > the
> >> >> >> >> >> > item
> >> >> >> >> >> > should be saved , can you safely add many items (like many
> >> >> >> >> >> > user
> >> >> >> >> >> > properties)
> >> >> >> >> >> > before actually saving the item?
> >> >> >> >> >> >
> >> >> >> >> >> > 2) I am working on an Outlook addin that works great on my
> >> >> >> >> >> > dev
> >> >> >> >> >> > machine
> >> >> >> >> >> > but
> >> >> >> >> >> > appearantly doesn't save/read userproperties for
> >> >> >> >> >> > appointment
> >> >> >> >> >> > items
> >> >> >> >> >> > but
> >> >> >> >> >> > task
> >> >> >> >> >> > items appearantly read/save fine on most systems.
> >> >> >> >> >> >
> >> >> >> >> >> >
> >> >> >> >> >>
> >> >> >> >> >>
> >> >> >> >> >>
> >> >> >> >>
> >> >> >> >>
> >> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>
|
|
| Back to top |
|
 |
|
|
| Related Topics: | Problem with UserProperties when creating MailItem with VBA Hi Group! I am creating my mail Items with the following code: (from Microsoft Access) .... Set myOlApp = Set myItem = = strSubject myItem.To = strMail ..... ' setting prope
Can send/receive at home, but only receive at work Outlook has no problems at home, but at work we can't send messages. Some of us get a password prompt, but the password doesn't work. We installed IIS yesterday on our server 2003 server--is that interfering? The IIS will not be used to access outside
space bar Why do I have to hit the space bar to open each message. Using Vista? Muff
Changing MailTo Protocol I want to deselect Windows Mail as my defail program for MailTo Protocols, however I am not able to deselect this file association through the Control Panel and when I go through IE no other program is offered for MailTo Protocols. I know that when I had
Outlook 2207 HTTP New Mail Notification Is it possible to some how have Outlook indicate when new mail has arrived in my MSN InBox? It will provide a pop-up notification for a pop3 account where the emails are delivered to my plain InBox but not for mail that arrives in my MSN InBox. Since rul |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|