1

Form type of appointment cab be defined in add-in manifest as folowing

 <Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Read"/>   

if an appointment already created, is there way to know current outlook add-in is running outlook edit mode or read mode using office js which looks like as following ?

if(Office.context.mailbox.item.FormType =="Read"){
  //
}

enter image description here

DevÁsith
  • 1,072
  • 12
  • 38
  • Another SO user had a similar query here https://stackoverflow.com/questions/52293787/in-an-outlook-addin-how-to-check-whether-we-are-in-compose-mode-or-read-mode". Let us know if this helped – Outlook Add-ins Team - MSFT Sep 10 '19 at 11:41

1 Answers1

0

You just need to define separate landing pages with actions to run in the manifest:

<ExtensionPoint xsi:type="MessageReadCommandSurface">
<Action xsi:type="ExecuteFunction">
    <FunctionName>FunctionSpecificToReadView</FunctionName>
</Action>
</ExtensionPoint>
<ExtensionPoint xsi:type="MessageComposeCommandSurface">
<Action xsi:type="ExecuteFunction">
    <FunctionName>FunctionSpecificToComposeView</FunctionName>
</Action>
</ExtensionPoint>

If you don't want to create two separate landing pages for read and compose modes you may check for the displayReplyForm API, this is available in the read mode. If this is not defined then you are in compose mode:

if (Office.context.mailbox.item.displayReplyForm != undefined) {
  // read mode
} else {
  // compose mode
}
Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45