Get custom property set in Outlook Add-In via Microsoft Graph

后端 未结 2 1462
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-07 02:54

Let\'s say I have in my Outlook Add-In (using Office.js) following code running on a compose form of an appointment:

c         


        
相关标签:
2条回答
  • 2020-12-07 03:31
    1. Per MS-OXCEXT, the interoperability doc on how add-ins store stuff in Outlook, custom properties are stored as a JSON dictionary in a MAPI extended property (gory details at that link). That means you should be able to access them via Graph extended properties, you would just have to parse the value yourself.
    2. Should be using extended properties and the "{type} {guid} Name {name}" format.
    3. I don't see why not.
    4. The answer isn't no, but I'll answer your follow up anyway :). Sure you can do this if you use the REST API from your add-in.
    0 讨论(0)
  • 2020-12-07 03:35

    TL;DR; Yes it is possible to read custom properties set by Office.js api loadCustomPropertiesAsync using REST APIs You need to create a REST call query that looks like

    string addinManifestId = "<your manifest guid here>";//lower cases
    string prop = @"String {00020329-0000-0000-C000-000000000046} Name"+ string.Format(" cecp-{0}", addinManifestId );
    var url = $"<apiEndpoint>/messages/<youritemid>?$expand=SingleValueExtendedProperties($filter=PropertyId eq '{propertyname}')";
    

    More info

    The documentation is available here https://msdn.microsoft.com/en-us/library/hh968549(v=exchg.80).aspx

    I had a similar problem when I needed to handle "sent mail" for my add-in Keluro. I implemented something really close to your approach with a web hook on REST API. To my knowledge it is the only way to handle sent items. Consider upvoting this https://officespdev.uservoice.com/forums/224641-feature-requests-and-feedback/suggestions/10964871-add-itemsend-event-so-add-in-can-cancel-email

    0 讨论(0)
提交回复
热议问题