Giter VIP home page Giter VIP logo

office-add-in-samples's Introduction

Office Add-ins code samples

Office Add-ins code samples are provided in this repo to help you learn, study, and build great Office Add-ins!

Getting started

The following samples show how to build the simplest Office Add-in with only a manifest, HTML web page, and a logo. They will help you understand the fundamental parts of an Office Add-in. For additional getting started information, see our quick starts and tutorials.

Completed tutorials

The following samples are the completed versions of various tutorials for Office Add-ins.

Name Description
Excel Tutorial - Completed This sample is the completed version of the Tutorial: Create an Excel task pane add-in that shows how to create an Excel add-in with a task pane and command ribbon buttons. The add-in shows how to create and sort a table, make a chart, freeze a row, protect a worksheet, and display a dialog box.
Outlook Tutorial - Completed This sample is the completed version of the Tutorial: Build a message compose Outlook add-in that shows how to build an Outlook add-in that can be used in message compose mode to insert content into the body of a message. The add-in shows how to collect information from the user, fetch data from an external service, implement a function command, implement a task pane, and display a dialog box.
PowerPoint Tutorial (Visual Studio) - Completed This sample is the completed version of the Tutorial: Create a PowerPoint task pane add-in that shows how to create a PowerPoint add-in with a task pane. The add-in shows how to add the Bing photo of the day to a slide, add text to a slide, get slide metadata, and navigate between slides.
PowerPoint Tutorial (yo office) - Completed This sample is the completed version of the Tutorial: Create a PowerPoint task pane add-in that shows how to create a PowerPoint add-in with a task pane. The add-in shows how to add an image to a slide, add text to a slide, get slide metadata, and navigate between slides.
Word Tutorial - Completed This sample is the completed version of the Tutorial: Create a Word task pane add-in that shows how to create a Word add-in with a task pane. The add-in shows how to insert and replace text ranges, paragraphs, images, HTML, tables, and content controls. The add-in also shows how to format text and how to manage content in content controls.

Blazor WebAssembly

Name Description
Create a Blazor WebAssembly Excel add-in Uses .NET Blazor technologies to build an Excel add-in.
Create a Blazor WebAssembly Word add-in Uses .NET Blazor technologies to build a Word add-in.
Create a Blazor WebAssembly Outlook add-in Uses .NET Blazor technologies to build an Outlook add-in.

Auth, Identity and Single Sign-on (SSO)

All of the following samples show how to access and work with a user's Microsoft Graph data using the Microsoft identity platform.

Host Auth approach Platform Name
Outlook add-in SSO ASP.NET server Use SSO in an Outlook Add-in with ASP.NET
Outlook add-in SSO Node.js server Use SSO with event-based activation in an Outlook add-in
Office Add-in SSO ASP.NET server Use SSO in an Office Add-in with ASP.NET
Excel add-in SSO Node.js server Use SSO in an Office Add-in with Node.js
Excel add-in MSAL React SPA Use MSAL.js for auth and Microsoft Graph in an Excel add-in
Excel add-in MSAL ASP.NET server Use MSAL.NET for auth and Microsoft Graph in an Excel add-in
Outlook add-in MSAL ASP.NET server Use MSAL.NET for auth and Microsoft Graph in an Outlook add-in

Office

Name Description
Save custom settings in your Office Add-in Shows how to save custom settings inside an Office Add-in. The add-in stores data as key/value pairs, using the JavaScript API for Office property bag, browser cookies, web storage (localStorage and sessionStorage), or by storing the data in a hidden div in the document.

Outlook

Name Description
Encrypt attachments, process meeting request attendees, and react to appointment date/time changes using Outlook event-based activation Shows how to use event-based activation to encrypt attachments when added by the user. Also shows event handling for recipients changed in a meeting request, and changes to the start or end date or time in a meeting request.
Identify and tag external recipients using Outlook event-based activation Uses event-based activation to run an Outlook add-in when the user changes recipients while composing a message. The add-in also uses the appendOnSendAsync API to add a disclaimer.
Set your signature using Outlook event-based activation Uses event-based activation to run an Outlook add-in when the user creates a new message or appointment.
Verify the color categories of a message or appointment before it's sent using Smart Alerts Uses Outlook Smart Alerts to verify that required color categories are applied to a new message or appointment before it's sent.
Verify the sensitivity label of a message Uses the sensitivity label API in an event-based add-in to verify and apply the Highly Confidential sensitivity label to applicable outgoing messages.

Excel

Name Description
Data types explorer Builds an Excel add-in that allows you to create and explore data types in your workbooks. Data types enable add-in developers to organize complex data structures as objects, such as formatted number values, web images, and entity values.
Open in Teams Creates a new Excel spreadsheet in Microsoft Teams containing data you define.
Insert an external Excel file and populate it with JSON data Insert an existing template from an external Excel file into the currently open Excel file. Then retrieve data from a JSON web service and populate the template for the customer.
Create custom contextual tabs on the ribbon This sample shows how to create a custom contextual tab on the ribbon in the Office UI. The sample creates a table, and when the user moves the focus inside the table, the custom tab is displayed. When the user moves outside the table, the custom tab is hidden.
Use keyboard shortcuts for Office add-in actions Shows how to set up a basic Excel add-in project that utilizes keyboard shortcuts.
Custom function sample using web worker Shows how to use web workers in custom functions to prevent blocking the UI of your Office Add-in.
Use storage techniques to access data from an Office Add-in when offline Demonstrates how you can implement localStorage to enable limited functionality for your Office Add-in when a user experiences lost connection.
Custom function batching pattern Batch multiple calls into a single call to reduce the number of network calls to a remote service.

Word

Name Description
Get, edit, and set OOXML content in a Word document with a Word add-in Shows how to get, edit, and set OOXML content in a Word document.
Import a Word document template with a Word add-in Shows how to import templates in a Word document.
Load and write Open XML in your Word add-in Shows how to add a variety of rich content types to a Word document using the setSelectedDataAsync method with ooxml coercion type.
Manage citations with your Word add-in Shows how to manage citations in a Word document.

Shared JavaScript runtime

Check out these samples if you want to take advantage of the shared runtime for your Office Add-in.

Date Name Description
Share global data with a shared runtime Shows how to set up a basic project that uses the shared runtime to run code for ribbon buttons, task pane, and custom functions in a single browser runtime.
Manage ribbon and task pane UI, and run code on doc open Shows how to create contextual ribbon buttons that are enabled based on the state of your add-in.

Additional samples

Name Description
Use a shared library to migrate your Visual Studio Tools for Office add-in to an Office web add-in Provides a strategy for code reuse when migrating from VSTO Add-ins to Office Add-ins.
Integrate an Azure function with your Excel custom function Learn how to integrate Azure functions with custom functions to move to the cloud or integrate additional services.
Dynamic DPI code samples A collection of samples for handling DPI changes in COM, VSTO, and Office Add-ins.

Learn more

To learn more about Office Add-ins, see the Office Add-ins documentation.

Questions and feedback

  • Did you experience any problems with a sample? Create an issue and we'll help you out.
  • We'd love to get your feedback about the samples. Go to our Office samples survey to give feedback and suggest improvements.
  • For general questions about developing Office Add-ins, go to Microsoft Q&A using the office-js-dev tag.

Join the Microsoft 365 Developer Program

Join the Microsoft 365 Developer Program to get resources and information to help you build solutions for the Microsoft 365 platform, including recommendations tailored to your areas of interest.

You might also qualify for a free developer subscription that's renewable for 90 days and comes configured with sample data; for details, see the FAQ.

Community

The Office Add-ins code samples are a community-driven effort that helps developers extend, build, and provision customizations for the Office platform. The source is maintained on this GitHub repo where anyone can participate. You can provide contributions to the samples, reusable components, and documentation. Office Add-ins code samples is owned and coordinated by Office engineering teams, but the work is done by the community for the community.

Please read the Contribute page to learn how to be an active part of this community.

Code of conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

office-add-in-samples's People

Contributors

1yefuwang1 avatar aafvstam avatar abidrahman-msft avatar alexjerabek avatar alison-mk avatar bawgz avatar davidchesnut avatar dependabot[bot] avatar devarvindsa avatar elegault avatar elizabethsamuel-msft avatar jansenbe avatar jonathanhuss avatar keyur32 avatar lauragra avatar lindalu-msft avatar microsoft-github-policy-service[bot] avatar msftbot[bot] avatar nancy-wang avatar nokafor avatar officeglobal avatar paolopia avatar rick-kirkham avatar samantharamon avatar shaofengzhu avatar sharepointing avatar simonjaeger avatar supernova-eng avatar thaystg avatar vesajuvonen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

office-add-in-samples's Issues

Is the excel-shared-runtime-scenario still in preview?

Note: This repo is only for questions related to its samples. If you have questions about how to use office.js or the Office developer platform, please post your question on https://stackoverflow.com. Tag your question with office-js or outlook-web-addins

Question

The readme for excel-shared-runtime-scenario still says it relies on preview features:

Note: The features used in this sample are currently in preview and subject to change. They are not currently supported for use in production environments. To try the preview features, you will need to join Office Insider. A good way to try out preview features is by using an Office 365 subscription. If you don't already have an Office 365 subscription, you can get one by joining the Office 365 Developer Program.

Is this still true? Does this sample use RibbonApi1.1 ([https://docs.microsoft.com/en-us/office/dev/add-ins/reference/requirement-sets/ribbon-api-requirement-sets])? Have these apis all reached general availability?

Thanks

Error thrown in AttachmentDemo for Outlook SSO sample

Question

Regarding: PnP-OfficeAddins/Samples/auth/Outlook-Add-in-SSO/

When I run the sample code inside an Outlook desktop client, select a message with an attachment, and click "Choose Attachments" it throws this error:

JavaScript critical error at line 150, column 11 in https://localhost:44355/Scripts/MessageRead.js\n\nSCRIPT1004: Expected ';'

That refers to the top line here from MessageRead.js (Column 11 is the word "function"):

async function saveAttachments(attachmentIds, options) {
    //Set default SSO options if they are not provided
    if (options === undefined) options = { allowSignInPrompt: true, allowConsentPrompt: true, forMSGraphAccess: true };
    
    showSpinner();

    // Attempt to get an SSO token
    try {
        let bootstrapToken = await OfficeRuntime.auth.getAccessToken(options);

        // The /api/saveAttachmentsUsingToken controller will make the token exchange and use the 
        // access token it gets back to make the call to MS Graph.
        // Server-side errors are caught in the .fail block of saveAttachmentsUsingToken.
        saveAttachmentsUsingToken("/api/saveAttachments", bootstrapToken, attachmentIds);
    }
    catch (exception) {
        // The only exceptions caught here are exceptions in your code in the try block
        // and errors returned from the call of `getAccessToken` above.
        if (exception.code) {
            handleClientSideErrors(exception);
        }
        else {
            showNotification("EXCEPTION: ", JSON.stringify(exception));
        }
    }

Any ideas?

Unathorized when save attachmment on outlook web

Hi, So I tried to run this repository
https://github.com/OfficeDev/PnP-OfficeAddins/tree/main/Samples/auth/Outlook-Add-in-SSO.
I already set all the requirements like app registration etc. And it's already running on my outlook desktop. But when I tried to run the add-in on the Outlook Website I always get the 401 Unauthorized code. the message is always
Authorization has been denied for this request.
When I see on my chrome dev tools it already sending the authorization token on the headers. But why it always returns the 401 status code.

outlook-set-signature. npm ron build not working as aspected.

Note: This template is only for reporting bugs about samples in this repo. If you have a product bug to report about Office web Add-ins, please submit the issue at https://github.com/OfficeDev/office-js/issues. This will help us respond to your issue faster.

(DELETE THIS PARAGRAPH AFTER READING)

outlook-set-signature

autorun not working anymore after running build and uploading it.

After running npm run build and uploading it to azure storage or other parts. The solution is not working anymore. After the polifill has done its job on outlook for desktop it is not working

Expected behavior

Autorun should give same result as in produtction build as dev

Environment

  • Platform [PC desktop, Mac, iOS, Office Online]: online and desktop
  • Host [Excel, Word, PowerPoint, etc.]: outlook
  • Office version number: 2105
  • Operating System: Windows 10
  • Browser (if using Office Online): Edge chrome

Office.ASP.NETCoreReactAddins can not be loaded the add-in module by Excel in debugging.

URL of sample
https://github.com/OfficeDev/PnP-OfficeAddins/tree/master/Samples/Office.ASP.NETCoreReactAddins

URL linking to the sample that has the bug.
https://github.com/OfficeDev/PnP-OfficeAddins/blob/master/Samples/Office.ASP.NETCoreReactAddins/excel-js/manifest.xml

Describe the bug
In debugging, Excel invoked by Visual studio could not load Add-in module from local web site.

A clear and concise description of what the bug is.
The manifest.xml file specified the Add-in page url. But it's wrong.
Line 72 of manifest.xml specified below.
Url id="Taskpane.Url" DefaultValue="~remoteAppUrl/taskpane.html"
But there is not taskpane.html in the sample project.
It must be index.html I think.

To Reproduce
After change it, It's working fine.

Steps to reproduce the behavior:

  1. Clone sample folder on Visual studio 2019
  2. Follow step to build Add-in project and solution
  3. Debug start
  4. Local web server started on Visual studio and Excel started
  5. Excel can not load add-in module. ( waiting to load forever )

Expected behavior
Add-in module is loaded and Task pane can be used.

A clear and concise description of what you expected to happen.
I only want to execute sample in original.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

  • Platform [PC desktop, Mac, iOS, Office Online]: PC Desktop
  • Host [Excel, Word, PowerPoint, etc.]: Excel
  • Office version number: Office 365 16.0.12527.20880 64Bits
  • Operating System: Windows 10 Home
  • Browser (if using Office Online): ______

Additional context
none

Add any other context about the problem here.
none

Thank you to provide this sample.
Regards.

Excel-custom-functions instructions result in Add-In Error

URL of sample

https://github.com/OfficeDev/PnP-OfficeAddins/blob/0354c2b155b52e4c6e37eee93b2bc62629256d80/Excel-custom-functions/AzureFunction/README.md

Describe the bug

When following the instructions to deploy the sample, Build and run the custom function item 3 is to run npm run start
upon this, webpack compiles, excel opens, but the excel add-in side window states

ADD-IN ERROR
This add-in is no longer available: add-ins inserted during development are only available during debugging from Visual Studio. Please open your project in Visual Studio and re-run your application, or deploy your add-in into a valid catalog and re-inser

To Reproduce

Steps to reproduce the behavior:
Follow the instructions until the event is reproduced

Expected behavior

I should be able to continue to the next step of the instructions

Screenshots

image

Environment

  • Platform [PC desktop, Mac, iOS, Office Online]: PC Desktop
  • Host [Excel, Word, PowerPoint, etc.]: Excel
  • Office version number: 1902
  • Operating System: Windows 10
  • Browser (if using Office Online): ______

Signature won't show on outlook for mac

Outlook-set-signature

Describe the bug

The plugin works well on outlook for windows and outlook for the web. but the signature wont show on outlook for Mac.

To Reproduce

Steps to reproduce the behavior:

  1. Set template to insert a button
  2. _click on the Test button(signature won't show)
  3. click on apply
  4. open new mail. No signature is added to the new email

Expected behavior

a signature should be added in all environments.

Environment

  • Platform [PC desktop, Mac]: Mac
  • Host [Excel, Word, PowerPoint, etc.]: Outlook
  • Office version number: 16.51
  • Operating System: Mac OS Big Sur

excel-shared-runtime-scenario not working

URL of sample

https://github.com/OfficeDev/PnP-OfficeAddins/tree/master/Samples/excel-shared-runtime-scenario

Describe the bug

On npm run sideload, Excel is started and there is an error saying Error installing add-ins : One of more add-ins failed to download a required resource

To Reproduce

Steps to reproduce the behavior:

  1. Downloaded source code.
  2. Follow steps mentioned in https://github.com/OfficeDev/PnP-OfficeAddins/tree/master/Samples/excel-shared-runtime-scenario
  3. Excel starts but there is an error installing add-ins.

Expected behavior

Addin is installed and it works as mentioned in the sample documentation.

Screenshots

image

image

If it helps, this is content of OfficeAddins.log.txt

image

image

Environment

  • Platform [PC desktop, Mac, iOS, Office Online]: PC desktop
  • Host [Excel, Word, PowerPoint, etc.]: Excel
  • Office version number: Microsoft 365 Apps for Enterprise, Version 2009 (Build 13205.20000), Beta Channel
  • Operating System: Windows 10 Pro
  • Browser (if using Office Online): NA

Additional context

Clicking on any of the buttons in ribbon does nothing.

Contextual tab ExecuteFunction is not working in excel on web

Referring to https://github.com/OfficeDev/PnP-OfficeAddins/tree/master/Samples/office-contextual-tabs, I have implemented contextual tab. There are buttons with type as "ExecuteFunction" and "ShowTaskpane". Both the types work in Excel on Windows. But, in Excel on web, clicking on a button which as type "ExecuteFunction" is not doing anything. The mapped function is not getting executed. "ShowTaskPane" works.
The issue is only with ExecuteFunction in Excel on web. The browser console does not show anything either.
What could be the issue? How do I find out why it's not working? Any logs that I look for?

excel-shared-runtime-scenario sample fails manifest validation

URL of sample

https://github.com/OfficeDev/PnP-OfficeAddins/tree/master/Samples/excel-shared-runtime-scenario

Describe the bug

The provided manifest.xml validation script fails for this sample. So now I'm not sure how to correctly configure a shared runtime with custom functions.

> office-toolbox validate -m manifest.xml

Calling validation service. This might take a moment...
-------------------------------------
Validation: Failed

Error #1: 
No Supported Office Products: There are no platforms which fulfil the requirements specified in the manifest. The most common reasons for this failure are issues in the Requirements section. Please review the manifest and try again. (link: undefined)

Removing the sharedRuntime requirement set fixes this. But am I really supposed to do that?

To Reproduce

Steps to reproduce the behavior:

  1. cd to sample
  2. yarn install
  3. yarn run validate

Expected behavior

Validate should pass

Environment

  • Platform [PC desktop, Mac, iOS, Office Online]: Mac
  • Host [Excel, Word, PowerPoint, etc.]: excel
  • Office version number: n/a
  • Operating System: Mac catalina
  • Browser (if using Office Online): ______

SSO for outlook add-in

Is your feature request related to a problem? Please describe.

Trying to implement SSO flow, please share any guidelines to implement Single Sign On.

Describe the solution you'd like

Should be able to get access token using SSO, and save email to SharePoint location. Current implementation has popup to get access token.

Describe alternatives you've considered

If we have to use popup for authentication, is there a best to avoid popup and sign in silently.

Additional context

Add any other context or screenshots about the feature request here.

Office Add-In Built Upon Angular that Uses a Shared JavaScript Runtime

I'm trying to generate a simple excel office add-in with a shared JavaScript runtime that uses Angular instead of React but can't seem to get it to work. The office add-in DOES work before I try to implement the JavaScript shared runtime.

I've gone through and applied all the relevant steps in this documentation but nothing seems to work as soon as I add this to the manifest.xml:

<Runtimes>
      <Runtime resid="ContosoAddin.Url" lifetime="long" />
</Runtimes>

My (naive) Assumption: If the source locations for the taskpane and commands were initialized in the same html file (index.html) and the above xml was included to the manifest.xml, the JavaScript shared runtime would be magically generated.

Questions:

  • Why is this assumption incorrect?
  • How can I generate the shared javascript runtime in an angular project?

Here's my repo for reference.

Thanks in advance!

Request for Feedback on Open in Excel sample

We're looking to expand sample code for some additional areas of the Open in Excel article.

Here are some ways we are looking to expand the sample:

  • Show how to embed data such as a table from the web page into the Excel document.
    • Should we show how to use OOXML to insert the data?
    • Or should we show how to use a custom query to insert the data?
  • Show how to create a document without using the OOXML SDK.
  • Show how to read custom properties passed to your add-in from the web page.
  • Show the sample using SSO.

For Office Add-in developers, how can we further develop this sample to help in your scenarios? Which areas are highest priority for you? Are there additional areas we should look at? Please comment on this issue and let us know how you'd like to see version 2 of the sample evolve.

Thanks!
Office Platform Extensibility team

How to download sample?

I don't understand how to download the sample files. The usual Clone and Download buttons are missing.
Thanks

Sample request: Contextual Ribbon UI

We're breaking the large scenario Manage ribbon and task pane UI, and run code on doc open into smaller bite-size samples.

This request is to break out the part of the sample that shows how to manage Ribbon buttons being enabled or disabled based on context of the UI and user actions. The goal is to show how to use the Ribbon management APIs documented at Enable and Disable Add-in Commands

The sample should have the following Ribbon buttons.

  • Connect. This pretends to connect to some backend service. The only actual action is that it enables the other buttons (Disconnect, Insert data). Connect is disabled when Disconnect is enabled (these two toggle).
  • Disconnect. This pretends to disconnect from a backend service. It disables itself, and the Insert data button. It enables the Connect button.
  • Insert data. Inserts a mock table of data into the spreadsheet (this can be the same data from the original sample). The table is named so that you can hook up events to it.
  • Sum. This button is connect to a table selection changed even (which the original sample has code for). When in the table, the button is enabled. When outside of the table, it is disabled. if the table does not exist, it is disabled.

Additional notes:

  • The Sum button should be connected to the table selection changed event from Office.Initialize (if the table exists such as from a saved document)
  • There is no task pane. So this is a cool way to show that you can run code without a task pane.
  • You'll still need a global state object of some sort to track button state, and update it as the buttons are used and toggled.

excel-shared-runtime-scenario cannot be run on Excel Version 2008 (Build 13117.20000) Beta Channel

Hello,

My laptop is installed with Office 364 Beta Channel Version 2008 (Build 13117.20000) and when i try to follow the steps in https://github.com/OfficeDev/PnP-OfficeAddins/tree/master/Samples/excel-shared-runtime-scenario

start npm start
npm run sideload

The sample is not running properly with errors when the excel application starts.
Please find the attached screenshot below. The add-in is not loaded properly.
github_excel_1

When the open taskpane is clicked, error message at the status bar saying failed to download resources.
github_excel_2

The excel version is beta channel (insiderfast)
github_excel_3

"Office.js has not fully loaded" when debugging Outlook-Add-in-SSO sample in Outlook for Windows

URL of sample

https://github.com/OfficeDev/PnP-OfficeAddins/tree/main/Samples/auth/Outlook-Add-in-SSO

When side-loading the manifest (or directly uploading the manifest on the "My add-ins" page) and starting Outlook for Windows, the task pane loads blank (with script errors in Visual Studio and from the F12 Chooser app's debugger).

To Reproduce

Steps to reproduce the behavior:

  1. Start Visual Studio Project with "Office Client" selected as startup in the Properties pane for the manifest project
  2. Load the add-in in Outlook for Windows

Expected behavior

The add-in loads without issues.

Screenshots

image

image

Environment

  • Platform [PC desktop, Mac, iOS, Office Online]: PC desktop
  • Host [Excel, Word, PowerPoint, etc.]: Outlook
  • Office version number: Microsoft Outlook for Microsoft 365 MSO (16.0.14228.20200) 64-bit
  • Operating System: Windows Server 2019 (Version 1908; OS Build 17763.2061)
  • Browser (if using Office Online): n/a

Invalid manifest: office-contextual-tabs

URL of sample

https://github.com/OfficeDev/PnP-OfficeAddins/tree/master/Samples/office-contextual-tabs

Describe the bug

Upload manifest and see a dialogue telling me the manifest is invalid

To Reproduce

  1. Download the manifest.xml file from this sample to a folder on your computer.
  2. Open Office on the web.
  3. Choose Excel, and then open a new document.
  4. Open the Insert tab on the ribbon and choose Office Add-ins.
  5. On the Office Add-ins dialog, select the MY ADD-INS tab, choose Manage My Add-ins, and then Upload My Add-in.
  6. Browse to the add-in manifest file, and then select Upload.

Expected behavior

Expected to see a PnP contextual tabs button on the Home tab on the ribbon.

Environment

  • Platform: Office Online
  • Host: Excel
  • Office version number: M365 Home
  • Browser: MS Edge

Issue loading the Outlook-Add-in-SSO

URL of sample

https://github.com/OfficeDev/PnP-OfficeAddins/tree/main/Samples/auth/Outlook-Add-in-SSO

Describe the bug

I was trying to run this sample, I was following all the configuration steps in the readme.md file, and I'm getting an error loading the component.

To Reproduce

  1. Follow all the steps in readme.md file to finally get the Application ID and the Client Secret, and use it in the sample.
  2. Run the sample and loggin with an acount in your tenant.
  3. Open an email with attachments and click on the button AttachmentDemoWeb Choose attachments to save.
  4. A new right pane window is opened with a loading indicator.
  5. The window shows an error like: "shomething went worng and the component can not be loaded..."

Screenshots

image

image

Environment

  • Platform PC desktop
  • Host Outlook
  • Office version number: 18.2106.12410.0
  • Operating System: Windows 10 version 19042

Debug error with ASP.NET React sample

Note: This repo is only for questions related to its samples. If you have questions about how to use office.js or the Office developer platform, please post your question on https://stackoverflow.com. Tag your question with office-js or outlook-web-addins

Question

I downloaded the sample and followed the instructions but something went wrong. Excel can't see the add-in. I named the project React1 Here are various steps...
React1 Warnings:
3> npm WARN deprecated [email protected]: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
3> npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
3> npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
3> npm WARN deprecated [email protected]: use String.prototype.padStart()
\Office.ASP.NETCoreReactAddins\excel-js\ClientApp\node_modules\webpack-dev-server\node_modules\fsevents\node_modules\yallist' -> 'C:\vba\PnP-OfficeAddins-master\Samples\Office.ASP.NETCoreReactAddins\excel-js\ClientApp\node_modules\webpack-dev-server\node_modules\fsevents\node_modules.yallist.DELETE'
3>
3> added 1644 packages from 846 contributors and audited 919705 packages in 410.089s
3> found 0 vulnerabilities
3>
3>Target CleanupEmptyRefsFolder:
3> Directory "C:\vba\PnP-OfficeAddins-master\Samples\Office.ASP.NETCoreReactAddins\excel-js\bin\Debug\netcoreapp2.2\refs" doesn't exist. Skipping.
3>
3>Build succeeded.
3> 0 Warning(s)
3> 0 Error(s)
3>
3>Time Elapsed 00:07:17.54
========== Build: 3 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
Note: Warnings seem to have been resolved.
Step 7: Properties/Application/Assembly name: = React1 (there is no Web Project property)
Note: only .NET 4.5.2 through 4.8 are available. This doesn't look right.
What happened to Net Core 2.2 Runtime (individual component)?

Step 8. In the Solution Explorer opened the manifest.xml file under the Office Add-in project (the project only contains a manifest file).
Copy and save the that has the GUID for your project.
Note: What to do with it?
6e00caac-8450-4ca5-b019-b5c6ac08cafa
Step 9. Copied the contents of the manifest.xml file in the ASP .NET Core project
and replaced all of the contents in the manifest file in the Web Add-in project (i.e. React1-Manifest.xml) with it.
Debug:
Upon Excel Launch:
ADD-IN Error: A problem occurred while trying to reach add-in.

My solution & project locations look like this:
ASP.NET Core_React_JavaScript.csproj
C:...\PnP-OfficeAddins-master\Samples\OfficeASP.NETCoreReactAddins\excel-js\ASP.NET_Core_React_Javascript.csproj
React1.sln
C:\Users\Martin\source\repos\React1

I have ASP.NET Core 2.2 loaded as an extension. It bothers me that it doesn't show up as a selection
in the properties/application/frameworks.
Also, could there be an issue with the Web Project property? Don't see it anywhere.
Thanks

Cookies not set/saved in Browser

URL of sample

https://github.com/OfficeDev/PnP-OfficeAddins/tree/3ce0e1b74152dbbe8306a091696bc4455c04c0a1/Samples/auth/Office-Add-in-Microsoft-Graph-ASPNET

Describe the bug

Note: The sample works fine in Windows Outlook, but not in Web Outlook in a browser.
The code sample uses http cookies to keep track of the state keys, but cookies are never saved when running in a web browser. The request to read the cookie returns null every time. This is the code part in Session.cs that doesn't work anymore. Tried in Chrome and Edge:

        public static string GetUserAuthStateId(HttpContextBase ctx)
        {
            string id;
            if (ctx.Request.Cookies[SessionKeys.Login.UserAuthStateId] == null)
            {
                // Convert GUID to a string and format as numeral to remove hyphens.
                id = Guid.NewGuid().ToString("N");
                ctx.Response.Cookies.Add(new HttpCookie(SessionKeys.Login.UserAuthStateId)
                {
                    Expires = DateTime.Now.AddMinutes(20),
                    Value = id
                });
            }
            else
            {
                id = ctx.Request.Cookies[SessionKeys.Login.UserAuthStateId].Value;
            }

            return id;
        }

To Reproduce

  1. Download and run the sample.
  2. Click "Connect to Office 365" button
  3. Click "Get Onedrive File Names"
  4. Get an exception here:
            var filesResult = await ODataHelper.GetItems<ExcelWorkbook>(fullWorkbooksSearchUrl, token.AccessToken);

because the cookie is never returned from request.

Expected behavior

I expect the code line in HomeController - Index() to return the state-id:

            var userAuthStateId = Settings.GetUserAuthStateId(ControllerContext.HttpContext);

Environment

  • Platform [PC desktop, Mac, iOS, Office Online]: PC
  • Host [Excel, Word, PowerPoint, etc.]: Outlook Web
  • Operating System: Windows 10
  • Browser (if using Office Online):
    • Google Chrome Version 88.0.4324.190
    • Microsoft Edge Version 89.0.774.45
    • Microsoft Edge Canary Version 91.0.822.0

Additional context

The sample is not modified at all. I've also tried to use Session state instead of cookies, but since Session uses cookies, there's no difference. I'm not using any 3rd party plugins for the browsers and I have a vanilla Edge installation with no changes to the settings.

Samples/auth/Office-Add-in-NodeJS-SSO/SSOAutoSetup fail on npm start

URL of sample

https://github.com/OfficeDev/PnP-OfficeAddins/tree/main/Samples/auth/Office-Add-in-NodeJS-SSO

Describe the bug

Running through the steps:

  1. npm install works (ofc)
  2. npm run configure-sso works (very clever btw)
  3. npm start fails!

Error: Cannot find module '/Users/camnealie/Downloads/PnP-OfficeAddins-main/Samples/auth/Office-Add-in-NodeJS-SSO/SSOAutoSetup/src/bin/www'

The folder it's looking for /src/bin/www simply doesn't exist in the repo - I'm guessing there's a compile process that's not configured correctly?

To Reproduce

Steps to reproduce the behavior:

Follow the install steps outlined in the readme

Expected behavior

Compiling and sideloading the addin to excel

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

  • Platform [PC desktop, Mac, iOS, Office Online]: Mac, office online
  • Host [Excel, Word, PowerPoint, etc.]: vsCode
  • Office version number: Online
  • Operating System: 10.15.7
  • Browser (if using Office Online): Chrome

Additional context

Add any other context about the problem here.

React Auth Sample login Issue

URL of sample

https://github.com/OfficeDev/PnP-OfficeAddins/tree/master/Samples/auth/Office-Add-in-Microsoft-Graph-React

Describe the bug

I followed the sample, however, the login process in popup window fails. Using debugger the error is:
AcquireToken_In_Progress: Error during login call - login is already in progress.
Then there are many cyclic redirects and the whole process failure at the end.

To Reproduce

Steps to reproduce the behaviour:

  1. Download the sample https://github.com/OfficeDev/PnP-OfficeAddins/tree/master/Samples/auth/Office-Add-in-Microsoft-Graph-React
  2. Follow the instructions and try to Run the project
  3. Push "Connect to Office 365" button

Expected behaviour

User is correctly logged in and the sample lists OneDrive files.

Environment

  • Platform [PC desktop, Mac, iOS, Office Online]: PC Desktop
  • Host [Excel, Word, PowerPoint, etc.]: Excel
  • Office version number: 2016 (16.0.5071.1000)
  • Operating System: Windows 10 Enterprise 2016 LTSB
  • Browser (if using Office Online): N/A

Additional context
Of course, the requirements say I need Excel version 16.0.6769.2001+ and I have 16.0.5071.1000. However, is it really the case? It seems the sample is using an older MSAL version. Is it an IE issue? For example, the following sample is working correctly in my environment: https://github.com/OfficeDev/Office-Add-in-NodeJS-SSO/

Example does not work on MacOS Big Sur

URL of sample

https://github.com/OfficeDev/PnP-OfficeAddins/tree/master/Samples/excel-shared-runtime-global-state

Describe the bug

Example does not show custom formula in excel on MacOS Big Sur (did not test on other versions). Task pane works well.

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'root folder of example'
  2. Run 'npm run start'
  3. Excel appears put into any cell '=CONTOSO.GETVALUEFORKEYCF("1")'
  4. See error

Expected behavior

It should work as described in the example Readme.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

  • Platform [Mac]: Mac
  • Host [Excel]: Excel
  • Office version number: 16.45
  • Operating System: macOS Big Sur 11.1
  • Browser (if using Office Online): ______

Additional context

Add any other context about the problem here.

Sample Request: Open/close task pane

We're breaking the large scenario Manage ribbon and task pane UI, and run code on doc open into smaller bite-size samples.

This request is to break out the part of the sample that shows how to programmatically open and close the task pane. So this sample only focuses on how to open or close the task pane, and show that the task pane is only hidden, not shut down.

The sample should have the following features.

  • Shows how to programmatically open and close task pane
  • Shows how to detect when the task pane is closed by the user, note: see Show or hide an Office Add-in in a shared runtime for the code details.
  • Has two buttons in ribbon (open and close) for managing the task pane. They are always active (this sample is not showing how to do a contextual ribbon).
  • The task pane does something interesting, perhaps starts or stops a timer so that the user can see the task pane remembers its state even when closed.
  • The task pane should just be TypeScript/HTML instead of React code (to keep this as simple as possible).

Office-Add-in-Microsoft-Graph-React Sample example - First try = Login is already in progress

I have followed the instructions from here and registered an app via azure to test this Sample:

  1. Register an application with the Microsoft Identity Platform
  • visit https://portal.azure.com/
  • login with excel 365 acc
  • [click ] on top left hand hamburger
  • [select] - Azure Active Directory
  • [scroll] to bottom of page to see icon - App registration
  • [click] App registration
  • [type name] Sample-Office-Add-in-Microsoft-Graph-React
  • [select] - Accounts in any organizational directory
  • [keep] - Web
  • [type - redirect uri] https://localhost:3000/login/login.html
  • [click] - register
  1. Copy client id to put into login/login.ts
  • [copy] Client ID
  • [paste] login/login.ts clientId
  1. certs - https://github.com/OfficeDev/generator-office/blob/master/src/docs/ssl.md#method-2-manually-install-the-certificate
  • cd to certs folder
cd Office-Add-in-Microsoft-Graph-React\certs
  • [Dbl click] - ca.crt
  • [click] Install certificate
  • [Select] Local Machine
  • [Select] Place all certificates in the following store
  • [click] browse
  • [Select] Trusted Root Certification Authorities
  • [click] ok
  • [click] next
  • [click] Finish
The import was successful

You now have a self-signed certificate installed on your machine.

  1. run cmd as administrator: run node application
yarn start
  • Note: Did not opwn separate cmd window. Stayed in same.
  1. Open new cmd terminal - run sideload
yarn run sideload
  1. in excel [click] - Open Add-in
  2. [click - button] Connect to Office 365

errorMessage: login_progress_error message: Login_In_Progress: Error during login call - login is already in progress. errorCode: ClientAuthError: Login_In_Progress: Error during login call - login is already in progress. at AuthError (eval code:26:9) at ClientAuthError (eval code:106:9) at ClientAuthError.createLoginInProgressError (eval code:143:9) at UserAgentApplication.prototype.acquireTokenInteractive (eval code:333:13) at UserAgentApplication.prototype.loginRedirect (eval code:246:9) at Office.initialize (eval code:50:13) at Anonymous function (https://appsforoffice.microsoft.com/lib/1.1/hosted/office.debug.js:1782:41) at validateFunction (https://appsforoffice.microsoft.com/lib/1.1/hosted/office.debug.js:306:21) at LoadScriptHelper.prototype.waitForFunction (https://appsforoffice.microsoft.com/lib/1.1/hosted/office.debug.js:318:13) at appReady (https://appsforoffice.microsoft.com/lib/1.1/hosted/office.debug.js:1778:25) .

I have looked in the other stackoverflow questions and github, and there is not a solution to this problem. Any advice.
thanks

Outlook.RelatedData mogic to retrieve reports and company is not implemented

in restService.js we have the two following functions

  function getCompany(mailbox){
      var deferred = $q.defer();
      var restQueryUrl = "https://localhost:44301/api/companies?$filter=substringof(Email,'" + mailbox.from.emailAddress + "')";
      $http({
        method: 'GET',
        url: restQueryUrl,
      /* etc. */
    }

And

   function getReports(mailbox) {
        var restQueryUrl = "https://localhost:44301/api/reports?mail=" + mailbox.from.emailAddress;
        return $http({
            url: restQueryUrl,
            method: "GET",
           /* etc. */
    }

It seems that there is no server side logic to handle those requests. In addition, they should target the proper server. The domain and the port 44301 are hardcoded.

AddIn not loading

Note: This repo is only for questions related to its samples. If you have questions about how to use office.js or the Office developer platform, please post your question on https://stackoverflow.com. Tag your question with office-js or outlook-web-addins

Question

Ask your question here.
I cloned the repo and was able to successfully compile with start npm start. Then when I do npm run sideload, excel launches but I see an "one or more add-in load failed" status pops up in the bottom but the buttons show up in the ribbon.. when i click on the buttons i see status show Conotoso Data importer is working on.. , but nothing happens.. Just wondering if I am missing some pre-req.. Appreciate help and guidance.

excel-shared-runtime-scenario: Taskpane loads wrong

Hi, could you help me?
When you click to show the taskpane, a small taskpane shows in the corner.
And this is happening with my application too.

image

Every time I have that issue, Edge Devtools shows two line.
image

To work, I always need to start with a ribbon button xsi:type="ShowTaskpane", but in my application all buttons are xsi:type="ExecuteFunction".

Minimize/Expand taskpane (Office add-in Excel) feature when only one taskpane is open/active

Hi,

In the sample code: PnP-OfficeAddins/Samples/excel-keyboard-shortcuts/

I would like to know how the minimize/expand icon appeared on the side vertical bar? is it in-built functionality of using "excel on web"?
Attached the picture with highlight to know what I mean.
MinimizeExpand

in my local machine, it did not appear the way it is in your sample. attached the picture.
MPSTaskPane

can you please give me pointers how to get side bar with an icon to show/hide when only one task pane is open.

FYI after upgrading excel office app and shared runtime is used, then multiple icons appear on the sidebar (vertical) but when only one taskpane is open sidebar does not appear and not able to hide/show the taskpane. Attached the pic.
MPSTaskPaneMultiple

Using VS 2019, office 365 version 1202.

Issue with login popup with Outlook Client. Authentication popup not closed with Outlook Client

Login(Authentication) pop is not closing in Outlook Client. Same scenario worked fine in Outlook web app with Chrome,Edge.

Specifically observed with Outlook Client. Assuming due to "Office.context.ui.messageParent" not returning Error/Success data to parent window.

Expected behavior*

Popup should close as user is authenticated.

Environment

  • Platform [PC desktop, Mac, iOS, Office Online]: PC
  • Host [Excel, Word, PowerPoint, etc.]: Outlook
  • Office version number: Outlook version( 2002)
  • Operating System: Windows 10/ Server 2016
  • Browser (if using Office Online): NA ( Outlook Client)

Office Addin MS Graph ASP.NET

Note: This repo is only for questions related to its samples. If you have questions about how to use office.js or the Office developer platform, please post your question on https://stackoverflow.com. Tag your question with office-js or outlook-web-addins

Question

C:\Office-Add-in-Microsoft-Graph-ASPNET\Office-Add-in-Microsoft-Graph-ASPNETWeb\Models\SessionToken.cs

Says I am missed a reference to JwtSecurityToken when I try to run. Did I do something wrong?

Office.ribbon.requestUpdate is throwing exception : The API you are trying to use is not available. It may be available in a different scenario.

URL of sample

https://github.com/OfficeDev/PnP-OfficeAddins/tree/main/Samples/office-contextual-tabs

Describe the bug

Followed instructions mentioned in https://github.com/OfficeDev/PnP-OfficeAddins/tree/main/Samples/office-contextual-tabs
Loaded the manifest, clicked on "Import Data" and the table showed up. Clicked on the table and the context tab did not show up. Instead there was an error in console saying

"Uncaught (in promise) RichApi.Error: The API you are trying to use is not available. It may be available in a different scenario.
at new n (excel-web-16.00.js:formatted:12049)
at r.i.processRequestExecutorResponseMessage (excel-web-16.00.js:formatted:14829)
at excel-web-16.00.js:formatted:14754"

This was working earlier and seems to be broken now.

To Reproduce

Steps to reproduce the behavior:
As mentioned above

Expected behavior

Context tab should show up.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

  • Platform [PC desktop, Mac, iOS, Office Online]: Office Online
  • Host [Excel, Word, PowerPoint, etc.]: Excel
  • Office version number: ______
  • Operating System: Windows 10
  • Browser (if using Office Online): Chrome

Additional context

This was working till 10th June 2021.

Enabling App Service Authentication causes word add-in to open in browser rather than in the task pane.

Note: This repo is only for questions related to its samples. If you have questions about how to use office.js or the Office developer platform, please post your question on https://stackoverflow.com. Tag your question with office-js or outlook-web-addins

Enabling App Service Authentication causes word add-in to open in browser rather than in the task pane.

At client request we have enabled the App Service Authentication (Classic), setting screenshot bellow.
image

Our application still runs within the online version of word with no issue however the desktop version of the app immediately attempts to open the word add-in in the browser for what I assume is authentication and shows nothing in the task pane.

Inspection of the task pane shows that no html is loaded before the authentication check

Is this something you have encountered before? or got a solution for?

Task Pane Working Online:
image

Task Pane On Desktop:
image

Browser Window Opened By Desktop Taskpane:
image

Outlook-Add-in-SSO api/saveAttachments 401 error

Question

I have followed he steps listed in the readme when i run the app i keep getting 401 error trying to post saveattachments endpoint. when i run the add in using the fallback dialog it works just fine. any help will be very appreciated. I am testing the addin using outlook web on edge.
after doing some debug I found the issue is with audience validation i get the following error
IDX10214: Audience validation failed. Audiences: 'System.String'. Did not match: validationParameters.ValidAudience: 'System.String' or validationParameters.ValidAudiences: 'System.String'.

Unable to get outlook add-in scopes or user identity

Hi,

I have used repository at https://github.com/OfficeDev/PnP-OfficeAddins/tree/main/Samples/auth/Outlook-Add-in-SSO to develop my first ever outlook web add-in. I have taken all steps suggested to register app to Azure as well with necessary changes to code.

The add-in requires to identify user without logging-in (similar to what Dynamics 365 outlook add-in does) and allow me to interact with microsoft graph api. This repository serves the purpose to some extent, but I am unable to sign-in silently.

All I need is to hit and execute Post function on SaveAttachmentsController.

With current [Authorize] attribute, my code won't hit the breakpoint set on Post function on SaveAttachmentsController.

If I remove [Authorize] attribute, my code will hit the breakpoint, but it won't be able to get list of scopes as ClaimsPrincipal.Current throws exception. User would then have to follow fallback login method which I would like to avoid.

Has anyone ever encountered this issue?
What should I change in code so I can keep [Authorize] attribute and still able to authorize the User silently to authenticate/communicate with Graph API?

Please help.

Regards,
Jay

Walkthrough?

Note: This repo is only for questions related to its samples. If you have questions about how to use office.js or the Office developer platform, please post your question on https://stackoverflow.com. Tag your question with office-js or outlook-web-addins

Question

i feel overwhelmed by this resource. Is there a very simple, step-by-step walkthrough to get started?

thx

ShowTaskpane URL

Note: This repo is only for questions related to its samples. If you have questions about how to use office.js or the Office developer platform, please post your question on https://stackoverflow.com. Tag your question with office-js or outlook-web-addins

Question

Referring to the sample under https://github.com/OfficeDev/PnP-OfficeAddins/tree/master/Samples/office-contextual-tabs , the action type "ShowTaskpane" is mapped to URL "Taskpane.Url".

I want to add another button in the context tab which should launch another task pane. something similar to how we achieve this with manifest.xml
<Control>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="myUrl" />
<Title resid="ButtonID" />
</Action>
</Control>
<bt:Url id="myUrl" DefaultValue="https://localhost:3000/myPage.html">

How can I do this with context tabs? I understood how "ExecuteFunction" is to be done but could not find an example for "ShowTaskpane" (another panel apart from the one which can be shown/hide using office API Office.addin.showAsTaskpane() and Office.addin.hide()).

excel-shared-runtime-scenario sample issues

URL of sample

sample link

Describe the bug

  1. Ribbon buttons (commands) are always enabled.
  2. The Sum Command doesn't work and crashes the add-in (after pressing Sum the add-in is not working anymore).
  3. Running the tasks "tsc: watch - tsconfig.json" or "tsc: build - tsconfig.json" in VS Code throws two errors.
  • The add-in loads and works fine after running start npm start and npm run sideload from command line (as per Build and run the solution paragraph), except the above issues 1 and 2.
  • I'm trying to run (and debug) it from VS Code, but issue 3 happens.

Expected behavior

  1. Some ribbon buttons should toggle their enable state, as per description.
  2. Sum functionality should work as described.
  3. I would appreciate any help in running this from VS Code.

Screenshots

Buttons always enabled
image

Add-in error after pressing Sum button
image

Available tasks in VS Code
image

Errors after running "tsc: watch - tsconfig.json"
image

Environment

  • Platform [PC desktop, Mac, iOS, Office Online]: PC desktop
  • Host [Excel, Word, PowerPoint, etc.]: Excel
  • Office version number: Excel for Microsoft 365 MSO (16.0.12730.20252) 64-bit
  • Operating System: Windows 10 Pro 1909 (18363.836) 64-bit
  • Browser (if using Office Online): ______

Adrian

Working Sample?

In the following article:

https://docs.microsoft.com/en-us/office/dev/add-ins/develop/dialog-api-in-office-add-ins

there is an image of a dialog that uses an external sign-in process. A secondary article:

https://docs.microsoft.com/en-us/office/dev/add-ins/develop/auth-with-office-dialog-api

discusses the technology.

Why is there no fully working sample? I would assume a couple of things:

  • a lot of folks might want to leverage a 3rd party provider such as those referenced in the dialog image shown in the above article.

  • one can also assume that many may have their own website or authentication model that they want to leverage as the 3rd party sign-in. For example, why not a sample that has an ASP.Net site the integrates for authentication / authorization with an Office add-in?

Lastly, many of the samples referenced in these articles do not appear to be using the latest add-in technologies.


Document Details

โš  Do not edit this section. It is required for docs.microsoft.com โžŸ GitHub issue linking.

How to get started on a similar project?

I have tried the excel-shared-runtime-scenario sample from Code. and want to create a similar project from scratch using VS Code. How do I get started to create a similar project? I am interested in the Enable/Disable of ribbon items.

Outlook.CRM app errors out and will not run

Hi there,

In the console whilst running the CRM outlook sample in browser I can see the following error

TypeError: Cannot read property 'id' of null
at controllers.js:33
at services.js:71
at angular.js:9408
at processQueue (angular.js:13248)
at angular.js:13264
at Scope.$eval (angular.js:14466)
at Scope.$digest (angular.js:14282)
at Scope.$apply (angular.js:14571)
at done (angular.js:9698)
at completeRequest (angular.js:9888)

And I am having alot of trouble trying to troubleshoot this. The spinner does work however, so the app is being loaded in outlook in browser.

I have created an app registration in Azure AD, and updated the webconfig with new clientID, secret, and ensured that the Office 365 services, and set as per instructions. I have also added the https://localhost:44321/ as a reply URL so all should be good.

I'm pretty familiar with Angular, ADAL, ASP.NET etc, but for some reason I'm stumped on this. Is it the case that Angular is complaining because the user.ID is not being passed through from the outlook app somehow, or is the backend process failing?

I have not created a new documentDB endpoint etc at this stage, I just wanted to test things out. Is it the case that I need to create the documentDB before the demo will actually work?

At this stage, it looks to me that the auth is failing.

Cheers, any help would be great

Nigel.

Office.ribbon.requestUpdate() throws Uncaught (in promise) RichApi.Error

Note: This repo is only for questions related to its samples. If you have questions about how to use office.js or the Office developer platform, please post your question on https://stackoverflow.com. Tag your question with office-js or outlook-web-addins

Question

I have created a sample project referring to https://docs.microsoft.com/en-us/office/dev/add-ins/quickstarts/excel-quickstart-jquery?tabs=yeomangenerator

Manifest and the API to Enable/Disable ribbon was written referring to https://docs.microsoft.com/en-us/office/dev/add-ins/design/disable-add-in-commands

The API Office.ribbon.requestUpdate() is throwing an exception saying....

Uncaught (in promise) RichApi.Error: The API you are trying to use is not available. It may be available in a different scenario.
at new RuntimeError (https://appsforoffice.officeapps.live.com/afo/lib/1.1/hosted/excel-web-16.00.debug.js:12735:36)
at RequestContext.ClientRequestContext.processRequestExecutorResponseMessage (https://appsforoffice.officeapps.live.com/afo/lib/1.1/hosted/excel-web-16.00.debug.js:15900:24)
at https://appsforoffice.officeapps.live.com/afo/lib/1.1/hosted/excel-web-16.00.debug.js:15805:43

I have https://appsforoffice.officeapps.live.com/afo/lib/1.1/hosted/office.debug.js in my html

Any idea what I am missing here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.