RudiBoy
RudiBoy

Reputation: 80

Property not supported exception

I am trying to get the AppointmentRecur property (PT_BINARY) of an Outlook 2007 appointment using this DASL: http://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/82160102 with the appointments PropertyAccessor. The response is a com exception property not supported. I read that this may be related to the size (> 8kb?) of property itself. I am not sure, so my question is how to get the property. I am specifically interested in the value of RecurFrequency. I want to be able to make the distinction between an appointment created as a daily appointment setting the every workday to true and an appointment that is created as a weekly appointment with Monday to Friday selected. Both appointments will have the same DayOfWeekMask (62) and will have a RecurrenceType Weekly. The only difference I can see is the value of RecurFrequency. Daily for the first and Weekly for the second.

Thanks in advance.

Upvotes: 0

Views: 32

Answers (2)

RudiBoy
RudiBoy

Reputation: 80

Thanks for getting back to me. Looks like you are right Dmitry. The problem is not specific to 2007. I get the same message in 2010. Getting a license for Redemption (looks like a great tool btw.) seems a bit of overkill to get to the one value.

I have been reading the article “read and parse a recurrence pattern” using the C++ Mapi route. Even if I could figure out how to properly do that. I would not know how to integrate that in my C# project.

I was kind of hoping that something like this would work:

var test = appointment.GetType().InvokeMember("dispidApptRecur", BindingFlags.GetProperty, null, appointment, null);

This works fine with the public properties of the appointment like Subject, but not with the property I am after. Name Unknown.

Any other ideas?

Upvotes: 0

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66286

Outlook likes playing a big brother, especially when you try to set some properties. But even reading some of them is blocked. Your options are:

  1. C++/Delphi and Extended MAPI - get the IMessage Extended MAPI interface off the AppointmentItem.MAPIOBJECT property, then use IMessage::GetIDsFromNames / IMessage::GetProps to retrieve the property, then parse the binary blob (no small feat in itself).
  2. Use Redemption (I am its author) - create an instance of the RDOSession object and reopen the appointment using RDOSession.GetRDOObjectFromOutlookObject or RDOSession.GetMessageFromID; the RDOAppointmentItem object exposes all recurrence properties (RDOAppointmentItem.GetRecurrencePattern(), RDORecurrencePattern object) in that blob. And you can still retrieve the blob using RDOAppointmentItem.Fields[].

Upvotes: 0

Related Questions