1

I want to find the owner of an appointment I'm creating on a shared calender. Is that possible?

I'm having the storeId from the folder by doing:

Folder folder = Appointment.Application.ActiveExplorer().CurrentFolder as Folder;
string storeid = folder.StoreID;

How can I get the owner?

1 Answers1

1

It doesn't seem as easy as it sounds. I thought there was an Owner property, but there isn't unfortunately.

I found this blog article that explains how you can extract the owner from the StoreID you already have.

The most important thing is to convert the string from a hexadecimal representation, and then use this regex:

private string ParseEntryID(string storeID)
{
    string s = HexReader.GetString(storeID);
    //TODO: These values might be different depending on
    what you have named your groups in ESM
    const string REG_EX = @"/o=First Organization/ou=First
        Administrative Group/cn=Recipients/cn=(\w+)";
    Match m = Regex.Match(s, REG_EX);

    return m.Value;
}

The code for the HexReader can be found in the article.

Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325
  • Thanks. The owner is not at that point of the string. Instead it is in front of /o=First Organization (maybe change between outlook 2010 / 2013). But the method helped me. So now I only must use a regex to get the mailadress. – Steffen Schindler Mar 20 '15 at 10:27
  • @SteffenSchindler: See [this](http://stackoverflow.com/questions/8655104/outlook-2007-vsto-add-in-get-email-sender-address). – Patrick Hofman Mar 20 '15 at 10:33
  • Doesn't work because in this example there is an email and it will get the sender. In my example I have an appointment and don't want the organizer. Instead i want the owner of the calender. So if you're a participant than the owner ist the participant of the meeting. – Steffen Schindler Mar 20 '15 at 11:06