Search code examples
outlook-addinoutlook-web-addins

Outlook Web Add In get Mailbox Folder Name


I am building an Outlook Web Add-in. When a message is opened I want to check if the message is in the Inbox, Sent Mail etc. and process accordingly. I do not know how to obtain that information, i.e., whether the message is in Inbox, Sent Mail etc. I have attached a snippet of code where I would like to obtain that information.

Office.onReady(function () {
    $(document).ready(function () {
        // Get if message is in Inbox, Sent Mail etc. here
    });
});

Solution

  • Currently the feature you requested, is not a part of the product. We track Outlook add-in feature requests on our user-voice page. Please add your request there. Feature requests on user-voice are considered, when we go through our planning process.

    As a workaround, get message can be used to obtain the ParentFolderId and then can be passed that onto get folder to retrieve details about the folder, including the name. We have documentation about Outlook Add-Ins and REST API with an example about getting a message using the ItemId.