是否可以获得共享日历的所有者[Outlook Interop]



我想找到我在共享日历上创建的约会的所有者。这可能吗?

我通过以下操作从文件夹中获取storeId:

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

我怎样才能找到失主?

这似乎并不像听起来那么容易。我以为有Owner属性,但不幸的是没有。

我发现了这篇博客文章,它解释了如何从现有的StoreID中提取所有者。

最重要的是从十六进制表示转换string,然后使用以下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;
}

HexReader的代码可以在文章中找到。

最新更新