The Excel Mail Merge Add-in for TypeScript connects to Microsoft Graph, gets email templates from a template folder in Outlook, and sends mail from a list of recipients in an Excel table.
To run the sample, you will need:
- Visual Studio 2015
- TypeScript for Microsoft Visual Studio min version 2.0.6.0
- Node.js
- An Office 365 developer account. If you don't have one, join the Office 365 Developer Program and get a free 1 year subscription to Office 365.
Register a web application in the app registration portal with the following configuration:
Parameter | Value |
---|---|
Name | Excel-Add-in-Microsoft-Graph-MailMerge |
Type | Web application and/or web API |
Sign-on URL | https://localhost:44390/index.html |
App ID URI | https://[your azure ad tenant name].onmicrosoft.com/Excel-Add-in-Microsoft-Graph-MailMerge |
Reply URL | https://localhost:44390/index.html |
Add the following permissions:
Application | Delegated Permissions |
---|---|
Microsoft Graph | Read/Write Mail |
Microsoft Azure Active Directory | Sign in and read user profile |
Save the application and make note of the client ID.
- Clone the GitHub repository.
- In Visual Studio, open the solution file Excel-Add-in-Microsoft-Graph-MailMerge.sln.
- In your Visual Studio project, open Excel-Add-in-Microsoft-Graph-MailMergeWeb/src/home/home.ts.
- Update '[Enter your clientId here]'` with the value from your Azure AD application.
- Update the '[redirect Url]' with your redirect Url.
- Open a command prompt to <sample directory>\Excel-Add-in-Microsoft-Graph-MailMergeWeb and run
npm install
and when that is finished, runnpm start
. - In Visual Studio, press F5 to run the sample.
- When Excel opens, select the Mail Merge command button from the Home tab.
- The task pane will open and you will be able to authenticate with Office 365 credentials once you click Sign in with Microsoft.
- Select from the list of templates.
- Review and edit the list of recipients.
- Preview and send the email.
We'd love to get your feedback about this sample. You can send your questions and suggestions to us in the Issues section of this repository.
Questions about Office 365 development in general should be posted to Stack Overflow. Make sure that your questions or comments are tagged with [office-addins].
- Office Add-in samples
- Office Add-ins platform overview
- Get started with Office Add-ins
- Office JavaScript API Helpers
Copyright (c) 2016 Microsoft Corporation. All rights reserved.