Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In an Outlook addin, how to check whether we are in compose mode or read mode?

I'm creating an outlook add-in and use the OfficeJS API in React app. In there I want to load a specific set of features for the compose mode and another set of features for the read mode. So my question is, how to see in which mode I'm currently on?

like image 475
THpubs Avatar asked Dec 10 '22 05:12

THpubs


1 Answers

I usually check for APIs to know the mode, if you don't want to create two separate landing pages for read and compose modes.

You can check for displayReplyForm API, this is a read mode API, so if this is undefined then you are in compose mode.

if (Office.context.mailbox.item.displayReplyForm != undefined) {
  // read mode
} else {
  // compose mode
}
like image 104
SureshGowtham S Avatar answered Jan 17 '23 07:01

SureshGowtham S