Search code examples
outlookcalendaroffice-addinsoutlook-web-addinsappointment

Outlook Web-addins - how can I get calendar name from appointment organizer?


I'm in the process of creating a web add-in for Outlook. I want to create a rule in JavaScript for which the content of an addon will only apply to a specific named calendar. Is there any way to get the name of the used calendar from the appointment edit?

I tried to set the rule in the xml manifest, but there was no way to check the calendar name either.


Solution

  • Office web add-ins work under the context of currently opened or active item only, not folders or stores. The Office JavaScript API (OfficeJS) doesn't provide any property or method for getting the folder where the item resides. See Missing API for retrieving folder of Office.context.mailbox.item for more information.

    You need to use EWS or Graph API for getting the parent folder info. For each item that triggers your add-in you need to check the parent folder by making REST API calls and only then continue any code execution.