Extracting Start/End date from calendar...

Aug 9, 2012 at 1:39 PM


I need to extract start & end date time from IMessage (Calendar), how to do that ?

foreach (IMessage message in f.Messages)

Thanks in advance.

Aug 13, 2012 at 6:16 AM

Found TagID,

PidTagICalendarStartTime, PidLidAppointmentStartDate

but not able to do using this id.



it thow exception....

Aug 17, 2012 at 1:30 AM

What is the exception message?  I think that would be a good place to start.

There's no guarantee that the property exists on a particular message (even if the exchange documentation says a property MUST be present on a certain message class).  Are you first checking the property exists?  Also, "0x00008212" looks like a LongId which means it's a named property, not a regular one.  You have to lookup that named property in the NameIDMap first, to get an actually property you can query for.  There's a change that 0x8212 would actually exist and return a property that you're not expecting.

If the property id is less than 0x8000, then you can just read the property as normal IF it exists (message.PropertyExists).  If you try and read a property that doesn't exist, it will throw an exception.  For property ids that are greater than 0x8000, get the INameIDMap from IPst.  Check to see if the named property exists (INameIdMap.PropertyExists(Guid, int/string)), and if it does, look it up to get the correct id to read from the message (INameIdMap.Lookup(Guid, int/string)).  You can use the PropId it returns to read it from the message.

In the case you have more questions regarding named properties, please refer to [MS-PST] Section http://msdn.microsoft.com/en-us/library/ff386230(v=office.12).aspx



Aug 17, 2012 at 8:16 AM

Hi Christopher,

i have solved this with same way (message.PropertyExists).

Thanks for reply.