0

How to know, Outlook add in is running in Browser or App, using jquery or javascript. Is there any key to know whether it is running from browser or Outlook App

2 Answers 2

1

@Sunny, you can determine this by using Office.onReady

Here's sample code for you:

Office.onReady(function(info) {
    if (info.host === Office.HostType.Outlook) {
        // This means you are running in Outlook.
    }
    else if (info.host == null) {
        // This means you are running in a browser, outside of Outlook
    }
    else {
        // This means you are running in some Office client that is NOT Outlook.
    }
});

More info can be found here

Sign up to request clarification or add additional context in comments.

Comments

0

You can use Office.context.mailbox.diagnostics.hostName, which returns Outlook, OutlookIOS, or OutlookWebApp

Use Office.context.platform, which works for office add-ins in general (not only Outlook), this returns Office.PlatformType

1 Comment

I upvoted this answer, which is the right answer, despite the downvotes. The Outlook Add-ins Team misunderstood the question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.