Office.ContextInformation interface

Provides information about the environment in which the add-in is running.

Remarks

Important: In Outlook, this object is available from Mailbox requirement set 1.5. For all Mailbox requirement sets, you can use the Office.context.mailbox.diagnostics property to get similar information.

Properties

host

Gets the Office application in which the add-in is running.

platform

Gets the platform on which the add-in is running.

version

Gets the version of Office on which the add-in is running.

Property Details

host

Gets the Office application in which the add-in is running.

host: Office.HostType;

Property Value

Examples

const contextInfo = Office.context.diagnostics;
console.log("Office application: " + contextInfo.host);

platform

Gets the platform on which the add-in is running.

platform: Office.PlatformType;

Property Value

Remarks

Important: In Outlook, OfficeOnline is returned if an add-is is running in Outlook on the web or in new Outlook on Windows.

Examples

const contextInfo = Office.context.diagnostics;
console.log("Platform: " + contextInfo.platform);

version

Gets the version of Office on which the add-in is running.

version: string;

Property Value

string

Examples

const contextInfo = Office.context.diagnostics;
console.log("Office version: " + contextInfo.version);