1

I am creating an outlook add-in with the Javascript API, and the ribbon has a button defined as below...

<Item id="msgCheckHelp">
  <Label resid="checkHelpLabel"/>
  <Supertip>
    <Title resid="checkHelpTitle"/>
    <Description resid="checkHelpDesc"/>
  </Supertip>
  <Action xsi:type="ExecuteFunction">
    <FunctionName>checkHelp</FunctionName>
  </Action>
</Item>

and then, the check help function is as defined here below...

function checkHelp (event) {
    window.open("help", "_blank");
    event.completed();
}

The problem is, this is not recognized as a user event. I tried looking at displayDialogAsync as an alternative to window.open, but it only loads as a popup as well.

1 Answers1

1

If you would like to display your help page within the application you would need to specify in your manifest different Action type as follow ...

<Action xsi:type="ShowTaskpane">
    <SourceLocation resid="appHelp" />
</Action>

And inside Resources section specify URL for the resource Id as follow ...

<bt:Urls>
    <bt:Url id="appHelp" DefaultValue="https://domain.../Help.html"/>
</bt:Urls>

Now, by clicking on the ribbon button, the task pain will open and display your help resource.

Please note: Action "ExecuteFunction" which provides hook up to FunctionFile element designed to run functions without UI interaction; you cannot use it with window.open() function.

Slava Ivanov
  • 6,666
  • 2
  • 23
  • 34
  • 1
    Show Taskpane shows inside the Add-in iframe, not as a new tab. – Joseph Whitley Jul 26 '17 at 13:02
  • 1
    @JosephWhitley You didn't say anywhere you want to open new tab of the browser. In fact what is gonna be in desktop or mobile Outlook? Anyways you have limited amount options and they are all described in the post: 1. Dialog API; 2. Inside task pane; 3. Link on the app page. And once again "ExecuteFunction" has to be UI-less. – Slava Ivanov Jul 26 '17 at 13:37