Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 02ec313

Browse files
authored
Update README.md
Added top header so sample will render appropriately in MS Samples gallery
1 parent 2ce0843 commit 02ec313

1 file changed

Lines changed: 86 additions & 86 deletions

File tree

README.md

Lines changed: 86 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -18,89 +18,89 @@ extensions:
1818
- OneDrive
1919
createdDate: 3/17/2016 9:42:20 AM
2020
---
21-
Insert Excel charts using Microsoft Graph in a PowerPoint Add-in
22-
23-
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.
24-
25-
![Insert Excel charts using Microsoft Graph in a PowerPoint Add-in sample](images/InsertChart.png)
26-
27-
## Introduction
28-
29-
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:
30-
31-
* Connect to Microsoft Graph from an Office Add-in.
32-
* Use the MSAL .NET Library to implement the OAuth 2.0 authorization framework in an add-in.
33-
* Use the Excel and OneDrive REST APIs from Microsoft Graph.
34-
* Show a dialog using the Office UI namespace.
35-
* Build an Add-in using ASP.NET MVC,MSAL, and Office.js.
36-
* Use add-in commands in PowerPoint.
37-
38-
39-
## Prerequisites
40-
41-
To run this code sample, the following are required.
42-
43-
* Visual Studio 2019 or later.
44-
45-
* SQL Server Express (No longer automatically installed with recent versions of Visual Studio.)
46-
47-
* An Office 365 account which you can get by joining the [Office 365 Developer Program](https://aka.ms/devprogramsignup) that includes a free 1 year subscription to Office 365.
48-
49-
* Excel workbooks (with charts) stored on OneDrive for Business in your Office 365 subscription.
50-
51-
* PowerPoint for Windows Desktop, version 16.0.6769.2001 or higher.
52-
* [Office Developer Tools](https://www.visualstudio.com/en-us/features/office-tools-vs.aspx)
53-
54-
* A Microsoft Azure Tenant. This add-in requires Azure Active Directiory (AD). Azure AD provides identity services that applications use for authentication and authorization. A trial subscription can be acquired here: [Microsoft Azure](https://account.windowsazure.com/SignUp).
55-
56-
## Configure the project
57-
58-
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.
59-
60-
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](http://blogs.technet.com/b/ad/archive/2013/11/08/creating-and-managing-multiple-windows-azure-active-directories.aspx). The section **Adding a new directory** will explain how to do this. You can also see [Set up your Office 365 development environment](https://msdn.microsoft.com/office/office365/howto/setup-development-environment#bk_CreateAzureSubscription) and the section **Associate your Office 365 account with Azure AD to create and manage apps** for more information.
61-
62-
3. Register your application using the [Azure Management Portal](https://manage.windowsazure.com). Sign-in with the account of an administrator or your Office 365 subscription. To learn how to register your application, see [Register an application with the Microsoft identity platforml](https://msdn.microsoft.com/office/office365/HowTo/add-common-consent-manually). Use the following settings:
63-
64-
- REDIRCT URI: https://localhost:44301/AzureADAuth/Authorize
65-
- SUPPORTED ACCOUNT TYPES: "Accounts in this organizational directory only"
66-
- IMPLICIT GRANT: Do not enable any Implicit Grant options
67-
- API PERMISSIONS: **Files.Read.All** and **User.Read**
68-
69-
> Note: After you register your application, copy the **Application (client) ID** and the **Directory (tenant) ID** on the **Overview** blade of the App Registration in the Azure Management Portal. When you create the client secret on the **Certificates & secrets** blade, copy it too.
70-
71-
4. In web.config, use the values that you copied in the previous step. Set **AAD:ClientID** to your client id, set **AAD:ClientSecret** to your client secret, and set **"AAD:O365TenantID"** to your tenant ID.
72-
73-
## Run the project
74-
1. Open the Visual Studio solution file.
75-
2. Right-click **PowerPoint-Add-in-Microsoft-Graph-ASPNET-InsertChart**, and then choose **Set as StartUp Project**.
76-
2. Press F5.
77-
3. In PowerPoint, open the **Insert** tab, and select **Pick a chart** to open the task pane add-in.
78-
79-
## Known issues
80-
81-
* Scenario: When trying to run the code sample, the add-in will not load.
82-
* Resolution:
83-
1. In Visual Studio, open **SQL Server Object Explorer**.
84-
2. Expand **(localdb)\MSSQLLocalDB** > **Databases**.
85-
3. Right click **PowerPoint-Add-in-Microsoft-Graph-ASPNET-InsertChart**, then choose **Delete**.
86-
* Scenario: When you run the code sample, you get an error on the line *Office.context.ui.messageParent*.
87-
* Resolution: Stop running the code sample and restart it.
88-
* If download the zip file, when you extract the files you get an error indicating that the file path is too long.
89-
* Resolution: Unzip your files to a folder directly under the root (e.g. c:\sample).
90-
91-
## Questions and comments
92-
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.
93-
Questions about Office 365 development in general should be posted to [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API). Ensure your questions are tagged with [office-js], [MicrosoftGraph] and [API].
94-
95-
## Additional resources
96-
97-
* [Microsoft Graph (Excel) ToDo code sample](https://github.com/microsoftgraph/aspnet-todo-rest-sample)
98-
* [Microsoft Graph documentation](https://docs.microsoft.com/en-us/graph/)
99-
* [Office Add-ins documentation](https://docs.microsoft.com/en-us/office/dev/add-ins/overview/office-add-ins)
100-
101-
## Copyright
102-
Copyright (c) 2016 - 2019 Microsoft Corporation. All rights reserved.
103-
104-
105-
106-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information, see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
21+
# Insert Excel charts using Microsoft Graph in a PowerPoint Add-in
22+
23+
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.
24+
25+
![Insert Excel charts using Microsoft Graph in a PowerPoint Add-in sample](images/InsertChart.png)
26+
27+
## Introduction
28+
29+
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:
30+
31+
* Connect to Microsoft Graph from an Office Add-in.
32+
* Use the MSAL .NET Library to implement the OAuth 2.0 authorization framework in an add-in.
33+
* Use the Excel and OneDrive REST APIs from Microsoft Graph.
34+
* Show a dialog using the Office UI namespace.
35+
* Build an Add-in using ASP.NET MVC,MSAL, and Office.js.
36+
* Use add-in commands in PowerPoint.
37+
38+
39+
## Prerequisites
40+
41+
To run this code sample, the following are required.
42+
43+
* Visual Studio 2019 or later.
44+
45+
* SQL Server Express (No longer automatically installed with recent versions of Visual Studio.)
46+
47+
* An Office 365 account which you can get by joining the [Office 365 Developer Program](https://aka.ms/devprogramsignup) that includes a free 1 year subscription to Office 365.
48+
49+
* Excel workbooks (with charts) stored on OneDrive for Business in your Office 365 subscription.
50+
51+
* PowerPoint for Windows Desktop, version 16.0.6769.2001 or higher.
52+
* [Office Developer Tools](https://www.visualstudio.com/en-us/features/office-tools-vs.aspx)
53+
54+
* A Microsoft Azure Tenant. This add-in requires Azure Active Directiory (AD). Azure AD provides identity services that applications use for authentication and authorization. A trial subscription can be acquired here: [Microsoft Azure](https://account.windowsazure.com/SignUp).
55+
56+
## Configure the project
57+
58+
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.
59+
60+
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](http://blogs.technet.com/b/ad/archive/2013/11/08/creating-and-managing-multiple-windows-azure-active-directories.aspx). The section **Adding a new directory** will explain how to do this. You can also see [Set up your Office 365 development environment](https://msdn.microsoft.com/office/office365/howto/setup-development-environment#bk_CreateAzureSubscription) and the section **Associate your Office 365 account with Azure AD to create and manage apps** for more information.
61+
62+
3. Register your application using the [Azure Management Portal](https://manage.windowsazure.com). Sign-in with the account of an administrator or your Office 365 subscription. To learn how to register your application, see [Register an application with the Microsoft identity platforml](https://msdn.microsoft.com/office/office365/HowTo/add-common-consent-manually). Use the following settings:
63+
64+
- REDIRCT URI: https://localhost:44301/AzureADAuth/Authorize
65+
- SUPPORTED ACCOUNT TYPES: "Accounts in this organizational directory only"
66+
- IMPLICIT GRANT: Do not enable any Implicit Grant options
67+
- API PERMISSIONS: **Files.Read.All** and **User.Read**
68+
69+
> Note: After you register your application, copy the **Application (client) ID** and the **Directory (tenant) ID** on the **Overview** blade of the App Registration in the Azure Management Portal. When you create the client secret on the **Certificates & secrets** blade, copy it too.
70+
71+
4. In web.config, use the values that you copied in the previous step. Set **AAD:ClientID** to your client id, set **AAD:ClientSecret** to your client secret, and set **"AAD:O365TenantID"** to your tenant ID.
72+
73+
## Run the project
74+
1. Open the Visual Studio solution file.
75+
2. Right-click **PowerPoint-Add-in-Microsoft-Graph-ASPNET-InsertChart**, and then choose **Set as StartUp Project**.
76+
2. Press F5.
77+
3. In PowerPoint, open the **Insert** tab, and select **Pick a chart** to open the task pane add-in.
78+
79+
## Known issues
80+
81+
* Scenario: When trying to run the code sample, the add-in will not load.
82+
* Resolution:
83+
1. In Visual Studio, open **SQL Server Object Explorer**.
84+
2. Expand **(localdb)\MSSQLLocalDB** > **Databases**.
85+
3. Right click **PowerPoint-Add-in-Microsoft-Graph-ASPNET-InsertChart**, then choose **Delete**.
86+
* Scenario: When you run the code sample, you get an error on the line *Office.context.ui.messageParent*.
87+
* Resolution: Stop running the code sample and restart it.
88+
* If download the zip file, when you extract the files you get an error indicating that the file path is too long.
89+
* Resolution: Unzip your files to a folder directly under the root (e.g. c:\sample).
90+
91+
## Questions and comments
92+
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.
93+
Questions about Office 365 development in general should be posted to [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API). Ensure your questions are tagged with [office-js], [MicrosoftGraph] and [API].
94+
95+
## Additional resources
96+
97+
* [Microsoft Graph (Excel) ToDo code sample](https://github.com/microsoftgraph/aspnet-todo-rest-sample)
98+
* [Microsoft Graph documentation](https://docs.microsoft.com/en-us/graph/)
99+
* [Office Add-ins documentation](https://docs.microsoft.com/en-us/office/dev/add-ins/overview/office-add-ins)
100+
101+
## Copyright
102+
Copyright (c) 2016 - 2019 Microsoft Corporation. All rights reserved.
103+
104+
105+
106+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information, see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

0 commit comments

Comments
 (0)