OfficeDev/PowerPoint-Add-in-Microsoft-Graph-ASPNET-InsertChart

Name: PowerPoint-Add-in-Microsoft-Graph-ASPNET-InsertChart

Owner: Office Developer

Description: An add-in connecting to OneDrive, finds workbooks, returns charts and inserts charts onto slides using Office.js

Created: 2016-03-17 16:42:20.0

Updated: 2017-12-10 20:28:34.0

Pushed: 2018-01-16 17:44:05.0

Homepage:

Size: 1115

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Insert Excel charts using Microsoft Graph in a PowerPoint Add-in

Learn how to build a Microsoft Office Add-in that connects to Microsoft Graph, finds all workbooks stored in OneDrive for Business, fetches all charts in the workbooks using the Excel REST APIs, and inserts an image of a chart into a PowerPoint slide using Office.js.

Insert Excel charts using Microsoft Graph in a PowerPoint Add-in sample

Introduction

Integrating data from online service providers increases the value and adoption of your add-ins. This code sample shows you how to connect your add-in to Microsoft Graph. Use this code sample to:

Prerequisites

To run this code sample, the following are required.

Configure the project
  1. In Visual Studio, choose the PowerPoint-Add-in-Microsoft-Graph-ASPNET-InsertChartWeb project. In Properties, ensure SSL Enabled is True. Verify that the SSL URL uses the same domain name and port number as those listed in step 3 below.

  2. Ensure your Azure subscription is bound to your Office 365 tenant. For more information, see the Active Directory team's blog post, Creating and Managing Multiple Windows Azure Active Directories. The section Adding a new directory will explain how to do this. You can also see Set up your Office 365 development environment and the section Associate your Office 365 account with Azure AD to create and manage apps for more information.

  3. Register your application using the Azure Management Portal. To learn how to register your application, see Register your browser-based web app with the Azure Management Portal. Use the following settings:

  4. SIGN-ON URL: https://localhost:44301/AzureADAuth/Authorize

  5. APP ID URI: https://localhost:44301

  6. REPLY URL: https://localhost:44301/AzureADAuth/Authorize

    Note: After you register your application, copy the client id and client secret that is shown in the Azure Management Portal.

  7. Grant permissions to your application.

    • In the Azure Management Portal, select the Active Directory tab and an Office 365 tenant.
    • Select the Applications tab and click the application that you want to configure. Choose Configure.
    • In permissions to other applications, add Microsoft Graph.
    • In Delegated Permissions, choose Read user files and files shared with user.
  8. In web.config, set AAD:ClientID to your client id, and set AAD:ClientSecret to your client secret.

Run the project
  1. Open the Visual Studio solution file.
  2. Right-click PowerPoint-Add-in-Microsoft-Graph-ASPNET-InsertChart, and then choose Set as StartUp Project.
  3. Press F5.
  4. In PowerPoint, choose Insert > Pick a chart to open the task pane add-in.
Known issues
Questions and comments

We'd love to get your feedback about the Insert Excel charts using Microsoft Graph in a PowerPoint Add-in sample. You can send your feedback to us in the Issues section of this repository. Questions about Office 365 development in general should be posted to Stack Overflow. Ensure your questions are tagged with [office-js], [MicrosoftGraph] and [API].

Additional resources
Copyright

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

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.