title | description | ms.date | ms.topic | ms.custom | ms.localizationpriority |
---|---|---|---|---|---|
Explore Office JavaScript API using Script Lab |
Use Script Lab to explore the Office JS API and to prototype functionality. |
11/10/2023 |
concept-article |
scenarios:getting-started |
high |
Script Lab is a free tool for anyone to learn how to develop Office Add-ins. Script Lab lets you to code and run the Office JavaScript APIs alongside your document in Excel, Outlook, PowerPoint, and Word. Use this convenient tool to prototype and verify the functionality you want in your own add-in.
[!div class="nextstepaction"] Get Script Lab for Excel, PowerPoint, and Word
[!div class="nextstepaction"] Get Script Lab for Outlook
See Script Lab in action in this one-minute YouTube video.
Script Lab is an add-in for prototyping add-ins. It uses the Office JavaScript API in Excel, Outlook, Word, and PowerPoint and sits in a task pane inside your document, spreadsheet, or email. It has an IntelliSense-enabled code editor, built on the same framework used by Visual Studio Code. Through Script Lab, you can access a library of samples to quickly try out features or use those samples as the starting point for your own code. You can even try upcoming APIs in Script Lab that are still in developer preview.
Script Lab offers a number of features to help you explore the Office JavaScript API and prototype add-in functionality.
Get started quickly with a collection of built-in sample snippets that show how to complete tasks with the API. You can run the samples to instantly see the result in the task pane or document, examine the samples to learn how the API works, and even use samples to prototype your own add-in.
In addition to JavaScript or TypeScript code that calls the Office JS API, each snippet also contains HTML markup that defines content of the task pane and CSS that defines the appearance of the task pane. You can customize the HTML markup and CSS to experiment with element placement and styling as you prototype task pane design for your own add-in.
Tip
To call preview APIs within a snippet, you'll need to update the snippet's libraries to use the beta content delivery network (CDN) (https://appsforoffice.microsoft.com/lib/beta/hosted/office.js
) and the preview type definitions @types/office-js-preview
. Additionally, some preview APIs are only accessible if you've signed up for the Microsoft 365 Insider program and are running an Insider build of Office.
By default, snippets that you open in Script Lab will be saved to your browser cache. To save a snippet permanently, you can export it to a GitHub gist. Create a secret gist to save a snippet exclusively for your own use, or create a public gist if you plan to share it with others.
You can import a snippet into Script Lab either by specifying the URL to the public GitHub gist where the snippet YAML is stored or by pasting in the complete YAML for the snippet. This feature may be useful in scenarios where someone else has shared their snippet with you by either publishing it to a GitHub gist or providing their snippet's YAML.
Script Lab is supported for Excel, Word, and PowerPoint on the following clients.
- Office on Windows*
- Office on Mac
- Office on the web
Script Lab for Outlook is available on the following clients.
- Outlook on Windows*
- Outlook on Mac
- Outlook on the web when using Chrome, Microsoft Edge, or Safari browsers
For more details on Script Lab for Outlook, see the related blog post.
Important
* Script Lab no longer works with combinations of platform and Office version that use the Trident (Internet Explorer) webview to host add-ins. This includes perpetual versions of Office through Office 2019. For more information, see Browsers and webview controls used by Office Add-ins.
[!div class="nextstepaction"] Get Script Lab for Excel, PowerPoint, and Word
[!div class="nextstepaction"] Get Script Lab for Outlook
Once you've prototyped your code in Script Lab, turn it into a real add-in with the steps in Create a standalone Office Add-in from your Script Lab code.