Using ProertyAccessor to Set and Get properties in a meeting request

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

Using ProertyAccessor to Set and Get properties in a meeting request
 
gera




Posts: 95
Joined: 2009-04-28
Hi,

I am using outlook 2007 and I am trying to set and get properties through PropertyAccessor.SetProperty and PropertyAccessor.GetProperty.

This works for a normal appointment item. But when attendees are added to the appointment item then the properties are not copied to the attendees appointment invitation (not only in the appointment mail but in the appointment itself), though the properties are added to the self. I checked it through OutlookSpy.

Here is the code that I use for set and get properties.

public static bool CreateExtendedProperty(object outlookItem, object value)
{
try
{

if (outlookItem is Outlook.AppointmentItem)
{
string prop = "http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/BookingType";
(outlookItem as Outlook.AppointmentItem).PropertyAccessor.SetProperty(prop, value);
}
return true;
}
catch (Exception ex)
{
MessageBox.Show("Error in adding assignment data to the outlook item. " + ex.Message);
return false;
}


}



public static object GetExtendedPropertyValue(object outlookItem, string property)
{
try
{

object result = null;
if (outlookItem is Outlook.AppointmentItem)
{
string prop = "http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/BookingType";
result = (outlookItem as Outlook.AppointmentItem).PropertyAccessor.GetProperty(prop);
}


return result;
}
catch (Exception ex)
{
return null;
}
}

-Geetha
Posted 02 Feb, 2011 04:09:50 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Geetha,

Could you please send a sample add-in project which can reproduce the issue to me? Please find the support e-mail address in the readme.txt file.

BTW What version and build number of Add-in Express do you use?
.NET, Extended MAPI, Windows Phone & RT
Posted 02 Feb, 2011 13:18:48 Top