Next Week Is MUCH Better For Me

[This is now documented here: https://msdn2.microsoft.com/en-us/library/bb905285.aspx]

This is just an interesting little nugget I was asked to document today.

Suppose you're writing some Outlook Object Model code (using Outlook 2007, of course) and are trying to classify the kinds of items you're working with. From the OOM, you'd start by looking at the type. Maybe it's Outlook.MailItem. or Outlook.Contact, etc. This article illustrates the concept.

But what about Outlook.MeetingItem? It turns out there's a number of things this could be. It could be a compose form if the message hasn't yet been sent. It could be a regular meeting response. Or it could be a counter proposal. A counter proposal is when the recipient of the request has proposed a new time for the meeting.

Detecting the compose case is easy - just check Item.Sent. But how do you tell if it's a counter proposal? That's not something we covered in the OOM. But there's a named property you can use to find out: dispidApptCounterProposal.

Since I'm a C++ guy, here's the C++ definition:

 #define dispidApptCounterProposal 0x8257

The property is in the PSETID_Appointment namespace (see my blog entry on Outlook 2007 properties). It's type is PT_BOOLEAN.

Here's some C# code that shows how you might use this property from the OOM:

    private bool IsCounterProposal(Outlook.MeetingItem meeting)
   {
      const string counterPropose =
         "https://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/8257000B";
      Outlook.PropertyAccessor pa = meeting.PropertyAccessor;
      if ((bool)pa.GetProperty(counterPropose))
         return true;
      else
         return false; 
   }