Getting Started with Office Add-ins
Get started with Office Add-ins (formerly Apps for Office)
An Office Add-in runs in an Office application and can interact with data in a document or mail item.
What development tool do you use?
- Install the Office Developer Tools for Visual Studio 2013 or 2015, if you haven’t already. These instructions also assume you have Office 2013 or later installed on your computer.
- Open Visual Studio and go to File > New > Project. Under Office/SharePoint, choose Add-in and then choose OK.
- In the app creation wizard, choose Task pane , choose Next, and then select the Office apps you want to target
- press F5 or the green Start button to launch the add-in. The add-in will be hosted locally on IIS, and Office will be opened with the add-in loaded.
First, install Node.js and Git if you haven’t already. If you are on a Mac, we recommend using Node Version Manager to install Node.js with the right permissions. If you are on Windows, you can install node.js from nodejs.org. Next, open a command prompt/terminal as administrator and run the following command:
npm install –g yo generator-office
Create a folder for your add-in project and go to that folder in the command prompt/terminal. Next, run the Yeoman generator for Office Add-ins to create the project scaffolding. Use the following command:
When prompted, supply the following information:
- New subfolder - N
- Add-in name - myHelloWorldAddin
- The supported Office application - you can choose any application
- Create new add-in - Yes, I want a new add-in.
- Use TypeScript - N
- Choose framework - Jquery
The Yeoman generator will then create the structure and basic files for your add-in.
Host your add-in. You can host your add-in locally, or use any web server or hosting technology – just make sure that the add-in is served using HTTPS, and update the add-in’s source location in the manifest. To host the add-in using npm, use the following command:
You will need to add the self-signed security certificate that is created as a trusted root certificate or your add-in will not display. You only need to do this once for all add-ins hosted this way.
Load the add-in into Office. The easiest way to do this is by sideloading the add-in in Office Online:
- Go to Office Online and create a blank Office Online Document.
- Go to Insert > Office Add-ins
- On the My Add-ins tab (or My Organization tab if you're signed in to a work or school account), you will see a link in the upper-right corner of the dialog box to Upload My Add-in or Manage My Add-ins. Manage My Add-ins will open a menu where you can then choose Upload My Add-in.
- In the Upload Add-in dialog, choose Browse and select the manifest-myhelloworldaddin.xml file from the root of the sample project folder, and then choose Upload. Your add-in will load in Office Online.
Load the add-in into Office. The easiest way to do this is by sideloading the add-in in Outlook.com or OWA:
- From your mailbox, click the gear icon in the upper-right corner of the page and choose Manage Add-ins. (If you don’t see Manage Add-ins, your account has not been migrated to Exchange yet. You can contact firstname.lastname@example.org to get your account migrated, or create a new Microsoft account.)
- On the Manage Add-ins page, choose the plus (+) icon and select Add from a file.
- Choose Browse and select the manifest-myHelloWorldAddin.xml file from the root of the sample project folder, then choose Next and Install. You will see instructions on how to view the add-in in Outlook.
You can create an Office add-in using any editor. To get started, we'll use the playground for add-ins.
A simple add-in project is loaded for you as a starting point.
Choose Start building below to go to the playground for add-ins. From there, sign in with your Microsoft account and choose Run to see the add-in work. If you want to use Visual Studio, choose Open in Visual Studio.
Download the sample and follow the instructions in the readme to run it.
Or, you can build an add-in from scratch using Visual Studio:
- Start Visual Studio. If you don't have Visual Studio, download the Visual Studio 2015 Community Edition for free.
- Choose File > New > Project.
- In the New Project dialog, choose Templates > Visual C# > Office/SharePoint > Apps.
At this point, if you don’t have Office Developer Tools installed in Visual Studio, choose Install Office Developer Tools projects and choose OK. You might be prompted to close Visual Studio as part of the installation process.
- After you’ve installed the Office Developer Tools, repeat steps 1 - 3 to return to the Office/SharePoint part of the New Project dialog.
- Choose App for Office and then OK. (Office Add-ins were formerly called Apps for Office.)
- Select Task pane as the app type and then Next.
- Select Word as the Office application that you want to host your add-in. You can select multiple options, and your add-in will run in any of the selected applications).
- Choose Finish.
- Choose Start (or F5) to run your add-in.
If you prefer to use an editor other than Visual Studio, keep in mind you can create an Office add-in using any editor.