{"id":4798,"date":"2020-06-10T12:36:50","date_gmt":"2020-06-10T19:36:50","guid":{"rendered":"https:\/\/officedevblogs.wpengine.com\/?p=4798"},"modified":"2022-09-28T14:11:17","modified_gmt":"2022-09-28T21:11:17","slug":"script-lab-now-supports-outlook","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/script-lab-now-supports-outlook\/","title":{"rendered":"Script Lab now supports Outlook"},"content":{"rendered":"<p>Wouldn\u2019t it be amazing if you could launch Outlook, open a small code window, and then instantly start writing and executing JavaScript that interacts with your emails and appointments? Recently, we released <a href=\"https:\/\/appsource.microsoft.com\/en-us\/product\/office\/WA200001603?tab=Overview\">Script Lab for Outlook<\/a> which lets you do exactly that and it\u2019s quite a good way to learn the JavaScript APIs for Outlook! The <strong>Script Lab for Outlook<\/strong> add-in is built in the same codebase as the Script Lab add-in for Excel, Word, and PowerPoint.<\/p>\n<p>Whether you&#8217;re new to writing code for Outlook or an experienced developer trying to prototype a feature for your add-in, Script Lab is a tool to learn about writing Office.js code for Outlook. The focus is the <a href=\"https:\/\/learn.microsoft.com\/en-us\/office\/dev\/add-ins\/reference\/javascript-api-for-office\">Office JavaScript API<\/a>, which is the technology you need to build Office add-ins that run across platforms.<\/p>\n<h2>Script Lab for Outlook features<\/h2>\n<h3>Code<\/h3>\n<p>Code in a floating window opened from your email or appointment. IntelliSense shows suggestions while you type so you can easily discover and use the Office JavaScript objects and methods. And if you don\u2019t want to start from scratch there are plenty of samples preinstalled with Script Lab. Your snippets can use any TypeScript features like the magical async\/await and conveniences like arrow functions and template strings. But it\u2019s not only script\u2014your snippets can also use HTML and CSS, and reference external libraries and data on the web. Script Lab uses the Monaco editor, the same tech that powers Visual Studio Code, so it\u2019s beautiful and lightweight.<\/p>\n<h3>Run<\/h3>\n<p>Run the code in the task pane beside your email or appointment. You can include logic, API calls to Office, UI in the pane, and even output to a console. Every time you make a code change, the editor refreshes, and you can run the new version in seconds.<\/p>\n<h3>Share<\/h3>\n<p>Share\u00a0your snippets through GitHub. If you create a snippet you\u2019d like to share, you can use Script Lab to save it then send the link to someone else for them to try it and tweak it on their computer. The <strong>Import<\/strong> feature lets you load other people\u2019s snippets. We think sharing will be especially useful for asking and answering questions about add-ins on Stack Overflow (tag <a href=\"http:\/\/stackoverflow.com\/questions\/tagged\/office-js\">office-js<\/a> on general add-ins questions or <a href=\"https:\/\/stackoverflow.com\/questions\/tagged\/outlook-web-addins\">outlook-web-addins<\/a> on Outlook add-ins questions).<\/p>\n<p><a href=\"https:\/\/appsource.microsoft.com\/product\/office\/WA200001603?tab=Overview\">Install Script Lab for Outlook<\/a> free from the Office Store. It works in Outlook 2013 and later on Windows, and Outlook 2016 and later on Mac. The add-in is currently only supported in Chrome, Microsoft Edge, and Safari.<\/p>\n<p>The source code in the <a href=\"https:\/\/github.com\/OfficeDev\/script-lab\">script-lab repo<\/a> is open to the community. We welcome your contributions to the tool and to our <a href=\"https:\/\/github.com\/OfficeDev\/office-js-snippets\">snippets repo<\/a>. We\u2019re excited to keep improving Script Lab with your help!<\/p>\n<h2>Get familiar with Script Lab for Office on each platform<\/h2>\n<p>The following screenshots show how you can access Script Lab for Outlook on each supported platform.<\/p>\n<h3>Script Lab for Outlook on the web<\/h3>\n<p>In Outlook on the web, Script Lab for Office appears in the left navigation pane.<\/p>\n<p><img decoding=\"async\" class=\"wp-image-4799 alignnone\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/06\/1-1024x576.jpg\" alt=\"Screenshot showing how to access Script Lab in Outlook on the web using the overflow menu.\" width=\"650\" height=\"365\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/06\/1-1024x576.jpg 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/06\/1-300x169.jpg 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/06\/1-768x432.jpg 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/06\/1.jpg 1366w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/p>\n<h3>Script Lab for Outlook on Windows desktop<\/h3>\n<p>On Windows desktop and in Outlook on Mac, find the Script Lab section on the ribbon to open the task pane.<\/p>\n<p><img decoding=\"async\" class=\"wp-image-4800 alignnone\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/06\/2-1-1024x576.png\" alt=\"Screenshot showing Script Lab ribbon buttons and task pane in Outlook on Windows desktop, and the Code window.\" width=\"650\" height=\"365\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/06\/2-1-1024x576.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/06\/2-1-300x169.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/06\/2-1-768x432.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/06\/2-1.png 1366w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/p>\n<h3>Script Lab for\u00a0Outlook on Mac<\/h3>\n<p><img decoding=\"async\" class=\"wp-image-4801 alignnone\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/06\/3-1-1024x694.png\" alt=\"Screenshot showing Script Lab ribbon buttons and task pane in Outlook on Mac, and the Code window.\" width=\"650\" height=\"441\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/06\/3-1-1024x694.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/06\/3-1-300x203.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/06\/3-1-768x521.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2020\/06\/3-1.png 1388w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/p>\n<p>We&#8217;d love your feedback and on <a href=\"https:\/\/github.com\/OfficeDev\/script-lab\/issues\">GitHub<\/a>! Happy coding!<\/p>\n<h2>Additional resources<\/h2>\n<p><a href=\"https:\/\/learn.microsoft.com\/en-us\/javascript\/api\/outlook?view=outlook-js-preview\">Outlook JavaScript API reference<\/a><\/p>\n<p><a href=\"https:\/\/developer.microsoft.com\/en-us\/outlook\">Outlook Dev Center<\/a><\/p>\n<p><a href=\"https:\/\/learn.microsoft.com\/en-us\/office\/dev\/add-ins\/overview\/explore-with-script-lab\">Script Lab Quick start<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Script Lab for Outlook enables you to launch Outlook, open a small code window, and instantly start writing and executing JavaScript that interacts with your emails and appointments.<\/p>\n","protected":false},"author":69076,"featured_media":25159,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11],"tags":[12,50],"class_list":["post-4798","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office-add-ins","tag-outlook","tag-script-lab"],"acf":[],"blog_post_summary":"<p>Script Lab for Outlook enables you to launch Outlook, open a small code window, and instantly start writing and executing JavaScript that interacts with your emails and appointments.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/4798","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/users\/69076"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/comments?post=4798"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/4798\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media\/25159"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media?parent=4798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=4798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=4798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}