Edit

Share via


Runtime element

Configures your add-in to use a shared JavaScript runtime so that various components all run in the same runtime. Child of the Runtimes element.

Add-in type:: Document, Mail, Presentation, Task pane, Workbook

Valid only in these VersionOverrides schemas:

  • Task pane 1.0
  • Mail 1.1

For more information, see Version overrides in the add-in only manifest.

Associated with these requirement sets:

Important

  • For the shared JavaScript runtime, this element enables the ribbon, task pane, and other supported components to use the same runtime. However, the SharedRuntime requirement set is only available in some Office applications. For more information, see Shared runtime requirement sets.
  • For event-based activation, this element enables your add-in to run on composing a new item, for example. For supported clients and other information, see Activate add-ins with events.
  • For integrated spam reporting, this element enables your add-in to process unsolicited messages. To learn more about how to implement the integrated spam reporting feature in your add-in, see Implement an integrated spam-reporting add-in.

Note that the event-based activation and integrated spam reporting features must use the same runtime. Multiple runtimes aren't currently supported in Outlook.

Syntax

<Runtimes>
    <Runtime resid="ContosoAddin.Url" lifetime="long" />
</Runtimes>

Contained in

Child elements

Element Required Description
Override No Specifies the URL location of the JavaScript file that Office on Windows requires for LaunchEvent extension point and ReportPhishingCommandSurface extension point handlers. Important: At present, you can only define one <Override> element and it must be of type javascript.

Attributes

Attribute Required Description
resid Yes Specifies the URL location of the HTML page for your add-in. The resid can be no more than 32 characters and must match an id attribute of a Url element in the Resources element.
lifetime No The default value for lifetime is short and doesn't need to be specified. Event-based activation and spam-reporting add-ins use only the short value. If you want to use a shared runtime in an Excel add-in, explicitly set the value to long.

lifetime attribute

Optional. Represents the length of time the add-in is allowed to run.

Available values

short: Default. Used only for event-based activation and spam-reporting add-ins. After the add-in is activated, it will run for a maximum amount of time as specified by the platform. Currently, that's around 5 minutes. This is the only value supported with event-based activation.

long: Used only when configuring a shared JavaScript runtime. The add-in can start on document open and run indefinitely. For example, task pane code will continue running even when the user closes the task pane. This is the only value supported by the shared runtime.

See also