1,116 questions with Microsoft 365 and Office | Development | Office JavaScript API tags

Sort by: Updated
2 answers One of the answers was accepted by the question author.

How can I reliably detect and handle document state changes in an Office.js add-in across Word and Excel?

I’m building an Office JavaScript add-in that needs to react when users modify the document (content changes, save events, or selection updates). However, event handlers behave inconsistently across Word and Excel, and some events don’t fire after…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-01-21T10:37:39.1933333+00:00
Wildoner Brandy 20 Reputation points
accepted 2026-01-21T14:41:18.6333333+00:00
Wildoner Brandy 20 Reputation points
2 answers

Update/Refresh Custom Properties/CustomXmlParts on word post replacing content using base64

Hi Team, We have a requirement to open a base64string document in same word instance, instead of opening it in a new word instance ( using createDocument(base64string).open() ). We were able to replace the content using…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-01-21T13:49:37.77+00:00
Rajat Bharadwaj 0 Reputation points
answered 2026-01-21T14:35:51.29+00:00
Steven-N 18,400 Reputation points Microsoft External Staff Moderator
2 answers

doc.undo() works in Desktop version of Word but fails in the Online version

Problem Statement : There is a Word document which is being modified by multiple people, not simultaenously though(basically supports co-authoring). This includes all redlines, all comments, content controls, customXMLMappings etc. The requirement is to…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-01-08T14:31:07.0366667+00:00
RahulK 0 Reputation points
commented 2026-01-21T10:47:14.9866667+00:00
RahulK 0 Reputation points
2 answers

How to handle large document updates through office-js addin.

I need to update the large documents like more than 350+ pages which has 3000+ paragraphs. I'm trying to add the soft hyphens by replacing the original word with the hyphenated word in document using wordrange.inserttext() method. (as others affect the…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-01-21T06:14:51.7433333+00:00
Soham Nale 0 Reputation points
answered 2026-01-21T10:37:59.63+00:00
TiNo-T 10,545 Reputation points Microsoft External Staff Moderator
2 answers

Sensitivity label file update office add-in

Hello, We are trying to allow the user to update a sensitivity label of a file through an office add-in. We noticed - even if our app registration has the right permissions - as long as any user has the file open, we get an error response that the file…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-01-15T07:05:29.4633333+00:00
Andreas Davros 71 Reputation points
commented 2026-01-16T11:58:29.3933333+00:00
Michelle-N 11,390 Reputation points Microsoft External Staff Moderator
1 answer

Need help with java code

// MOLF - Fill ONLY (1 AR at a time). No Submit clicks. // Paste 1 Excel row (TAB-separated, NO header): // FirstName | MiddleName | LastName | Role | JobTitle | Email | PhoneType | PhoneNumber | Country (function () { // Expose globally so bookmarklet…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-01-12T18:03:05.7633333+00:00
Lakshmi Polisetti 20 Reputation points
commented 2026-01-14T15:06:39.71+00:00
Flora-T 9,445 Reputation points Microsoft External Staff Moderator
3 answers One of the answers was accepted by the question author.

How to get the content of a comment that has been clicked on ?

Hello, I am currently working on a Microsoft Add-In by using the Office js API and I need to retrieve the content of comments from a word document. I have been able to find how to retrieve the content of the comment when clicking on the text attached to…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2025-11-24T10:11:05.99+00:00
Ariel NORA 20 Reputation points
answered 2026-01-13T13:24:06.36+00:00
Challapall, Madhu Babu 0 Reputation points
2 answers One of the answers was accepted by the question author.

Outlook add in after email send event

Hello, I'm developing an Outlook add in, specifically targeting new Outlook. One of my requirements is to trigger a UI workflow after an email is sent that will save the email to a third party system. I've attempted to do this with the OnSend event,…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-01-12T03:40:58.2166667+00:00
Stephen-9228 20 Reputation points
commented 2026-01-13T08:11:49.58+00:00
Teddie-D 10,800 Reputation points Microsoft External Staff Moderator
1 answer

Excel Add-in: Is There a Truly Unique Workbook Instance ID (Not Copied on Save As)?

We have an Excel addin written in JavaScript and have found a limitation that we'd like to know if it's truly a limitation or is not clearly understanding the Excel API. We want to store some information in a database that we can reference via an id we…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-01-12T15:31:14.1833333+00:00
Aldo Sanchez 0 Reputation points
answered 2026-01-13T02:25:58.15+00:00
Dora-T 9,315 Reputation points Microsoft External Staff Moderator
1 answer One of the answers was accepted by the question author.

Office API: how should API access be centrally managed and governed to ensure security

Im operating multiple internal applications and services consume Office APIs (Microsoft Graph and workload-specific APIs) across SharePoint, Teams, Exchange, and OneDrive. These APIs are accessed by different solutions using both delegated and…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-01-12T12:03:55.9033333+00:00
Alexander Thomas 20 Reputation points
commented 2026-01-12T13:41:38.3733333+00:00
TiNo-T 10,545 Reputation points Microsoft External Staff Moderator
1 answer One of the answers was accepted by the question author.

I'm integrating Office Apps in my product using Graph API and encountering the following error

I'm integrating Office Apps in my product using Graph API and encountering the following error: { "code":"AuthenticationError", "message":"Error authenticating with resource", "innerError": { How can…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-01-12T03:28:45.9866667+00:00
Mcelhenney Liza 60 Reputation points
accepted 2026-01-12T06:58:49.3366667+00:00
Mcelhenney Liza 60 Reputation points
2 answers

Possibility for opening the onedrive inside the outlook desktop using Officejs from outlook addin

i am developing an outlook addin using yeoman and reactjs. i am loading my addin in a popup window instead of sidetaskpane. i am using officejs for opening the popup window and also opening new mail using displaydialogasync function which i get from…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-01-08T15:00:37.1366667+00:00
Development One 0 Reputation points
commented 2026-01-12T03:43:43.84+00:00
Flora-T 9,445 Reputation points Microsoft External Staff Moderator
1 answer

How to remove debug pop up on add in load

Hello all, Currently developing a JavaScript add-in for Microsoft word and are looking to start running live tests with users. To facilitate this I wish to remove the following pop-up that appears when the add in button is pressed. (Clicking…

Microsoft 365 and Office | Development | Office JavaScript API
Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Microsoft 365 and Office | Word | For business | Windows
asked 2023-03-24T09:39:49.4133333+00:00
Keith McClung 10 Reputation points
commented 2026-01-08T10:28:52.72+00:00
Martin Parkur 5 Reputation points
1 answer

Web Excel Unable to import base64 but working with Excel Desktop

Only issue with Web excel in import using office.js but working with Excel Desktop const workbook = context.workbook; const base64 ="" workbook.insertWorksheetsFromBase64(base64, { positionType: Excel.WorksheetPositionType.end, });…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-01-07T05:57:38.5566667+00:00
Aakash Gautam 0 Reputation points
commented 2026-01-07T12:52:40.2066667+00:00
Michelle-N 11,390 Reputation points Microsoft External Staff Moderator
2 answers

How to make my Outlook addin visible on Mac

manifest-prod - New version.Monkata.xml Hi, Please advice how to make outlook addin visible on Mac. Manifest is uploaded. Thanks.

Microsoft 365 and Office | Development | Office JavaScript API
asked 2025-12-22T14:13:56.68+00:00
Kostadin Kostadinov 0 Reputation points
edited the question 2025-12-30T15:09:23.5733333+00:00
Ana M 0 Reputation points Moderator
2 answers

Table of Contents not auto-generated or updated in Word Online (Word for the Web)

Hi Team, I am programmatically generating Word (.docx) documents using JavaScript (docx library). The document contains: Proper Heading styles (Heading 1, Heading 2) A valid Table of Contents field When I open the document in Microsoft Word Desktop,…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2025-12-28T10:37:10.3866667+00:00
Nishi Sharma 0 Reputation points
answered 2025-12-28T14:30:37.03+00:00
Carlo Luna 6,840 Reputation points Independent Advisor
2 answers

Does the "online" word document support removing/adding content control along with text? If YES, what Office.js API can be used?

Hi Team, My requirement in Word document using Office.js APIs in both desktop version and web version are- remove the text with its content control add the text with content control I could perform both actions above in 'Desktop version' without any…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2025-12-18T08:35:30.38+00:00
Ajith Hegde 0 Reputation points
commented 2025-12-24T14:27:38.6233333+00:00
Flora-T 9,445 Reputation points Microsoft External Staff Moderator
1 answer One of the answers was accepted by the question author.

Published Outlook Add-in - only OnMessageSend not triggering

I have published this add-in for more than a year, previously I've only tested with the old Outlook on Windows and it works perfectly. Now I've changed some of the JS scripts (but not my manifest.xml) to make some features work with the new Outlook on…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2025-12-19T02:16:03.3166667+00:00
Vincent Lee 20 Reputation points
edited the question 2025-12-23T09:59:33.33+00:00
Jack-Bu 5,745 Reputation points Microsoft External Staff Moderator
1 answer

Is it possible to Compare two base64 document using Word JS API? I don't want to compare with currently opened document. Requirement is to compare two different word document.

Is there a way to invoke Word.Document.Compare or compareFromBase64 method from Word Javascript API to compare two Word documents in base64 format? I don't want to compare with currently opened document. Requirement is to compare two different word…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2025-12-19T07:27:18.1133333+00:00
Rajat Bharadwaj 0 Reputation points
commented 2025-12-22T10:55:36.1366667+00:00
Gabriel-N 11,670 Reputation points Microsoft External Staff Moderator
1 answer One of the answers was accepted by the question author.

login.microsoftonline.com/common/oauth2/v2.0/logout?post_logout_redirect_uri does not use the provided redirect URI

im using Microsoft OAuth2 to authorize users and obtain access and refresh tokens, in some cases I need the user to logout form the application, I used the redirect URI in the authorization process and it worked fine, and after the user successfully sign…

Microsoft 365 and Office | Development | Office JavaScript API
Microsoft Security | Microsoft Authenticator
Microsoft Security | Microsoft Graph
asked 2023-06-19T13:41:45.08+00:00
Abdalla Dimes 20 Reputation points
answered 2025-12-20T09:39:02.3733333+00:00
Chetan Belhekar 0 Reputation points