Skip to content

An Excel Add-in the connects to Microsoft Graph, gets a template folder from Outlook, and sends mail from a list of recipients in an Excel table.

License

Notifications You must be signed in to change notification settings

OfficeGSX/Excel-Add-in-TypeScript-MailMerge

Repository files navigation

Excel Add-in TypeScript MailMerge

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.

Start page

Prerequisites

To run the sample, you will need:

Run the add-in

Register your app in Microsoft Azure

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.

Set up your environment

  1. Clone the GitHub repository.
  2. In Visual Studio, open the solution file Excel-Add-in-Microsoft-Graph-MailMerge.sln.

Update the client id

  • 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.

Run the add-in

  1. Open a command prompt to <sample directory>\Excel-Add-in-Microsoft-Graph-MailMergeWeb and run npm install and when that is finished, run npm start.
  2. In Visual Studio, press F5 to run the sample.
  3. When Excel opens, select the Mail Merge command button from the Home tab.

Command button

  1. The task pane will open and you will be able to authenticate with Office 365 credentials once you click Sign in with Microsoft.
  2. Select from the list of templates.

Select a template

  1. Review and edit the list of recipients.

Edit recipients

  1. Preview and send the email.

Preview and send emails

Questions and comments

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].

Additional resources

Copyright

Copyright (c) 2016 Microsoft Corporation. All rights reserved.

About

An Excel Add-in the connects to Microsoft Graph, gets a template folder from Outlook, and sends mail from a list of recipients in an Excel table.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published