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

Sort by: Updated
1 answer

Outlook Office Add-in dropdown renders at top-left corner instead of near command button

I am developing an Outlook Office Add-in (Web Add-in using Office.js). My add-in has two sub-features: A Settings popup A Task pane for processing email data When the user clicks the Apps button inside an email, Outlook shows the list of installed…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-02-11T09:09:51.03+00:00
Nguyễn Trọng Cảnh 0 Reputation points
edited the question 2026-02-11T15:09:52.4433333+00:00
Jack-Bu 5,905 Reputation points Microsoft External Staff Moderator
2 answers

Questions regarding Outlook Add-in validation with local endpoint

Hello, I’m currently working on an Outlook add-in with a manifest in JSON format that needs to access information available only on the local endpoint. Using a hosted server is not possible in this scenario. I have several technical questions regarding…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-02-11T10:21:03.4033333+00:00
rubiks cube 0 Reputation points
edited an answer 2026-02-11T12:38:30.61+00:00
Michelle-N 12,505 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 20 Reputation points
commented 2026-02-11T09:26:24.9133333+00:00
RahulK 20 Reputation points
2 answers

Insert shapes in Powerpoint Web does not reflect instantly

Hello, We are trying to add textboxes into presentation Slide Masters (Powerpoint). On Web (powerpoint online), it's noticed that after inserting textboxes to Slide Masters the change is not reflected instantly in the presentation, and it might not be…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-02-09T12:14:40.6633333+00:00
Andreas Davros 91 Reputation points
commented 2026-02-10T08:33:28.1166667+00:00
Michelle-N 12,505 Reputation points Microsoft External Staff Moderator
2 answers One of the answers was accepted by the question author.

Office add-in manipulate powerpoint headers/footers

Our main question is how we can manipulate headers and footers for a powerpoint file using office.js or another library/tehcnology available in the office add-ins context. We currently notice that there is no supported method in office.js. Is this…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2025-11-25T10:50:39.86+00:00
Andreas Davros 91 Reputation points
accepted 2026-02-09T12:10:15.0133333+00:00
Andreas Davros 91 Reputation points
2 answers One of the answers was accepted by the question author.

compareFromBase64 does not work in Windows desktop Word and neither in Word online

Problem Statement : We have a requirement to compare the currently opened document with a second document(which has some additional changes). Current Approach : We are using the method compareFromBase64 to compare between the two documents via…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-02-05T14:18:33.7866667+00:00
RahulK 20 Reputation points
commented 2026-02-09T10:35:33.9866667+00:00
Michelle-N 12,505 Reputation points Microsoft External Staff Moderator
4 answers

V W X Y Z v w x y z : only these letters are not being selected correctly using Select Case function in VBA.

V W X Y Z v w x y z : only these letters are not being selected correctly using Select Case function in VBA. not working for select case, using either the "_" or the ascii code, upper or lower case. Works for every other letter and number.…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-02-02T20:10:30.31+00:00
Philipp Borer 0 Reputation points
commented 2026-02-05T12:28:25.6366667+00:00
Flora-T 10,765 Reputation points Microsoft External Staff Moderator
2 answers

Header image(s) broken in document after using Office.context.document.getFileAsync with Office.FileType.Compressed

I am trying a usecase where requirement to upload the open document via addin using REST API which accepts base64 of word document. I used Office.context.document.getFileAsync function passing input as "Office.FileType.Compressed". But the…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-01-30T13:58:02.9666667+00:00
Rajat Bharadwaj 5 Reputation points
commented 2026-02-05T06:43:38.27+00:00
Matthew-P 10,675 Reputation points Microsoft External Staff Moderator
1 answer

What is the relation between Office.AutoShowTaskpaneWithDocument and Office.addin.setStartupBehavior+Office.addin.showAsTaskpane

In investigating auto-open for our add-in, we found two different routes through which to ensure auto-open. They seem to be able to perform similar features through an entirely different way and API. The first one is documented here:…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-01-26T13:42:37.3+00:00
Mark 5 Reputation points
edited an answer 2026-01-28T01:11:26.75+00:00
TiNo-T 10,820 Reputation points Microsoft External Staff Moderator
1 answer

insertWorksheetsFromBase64 works in Excel Desktop but fails in Excel for the Web (Office.js)

Where importing worksheets using Office.js works correctly in Excel Desktop, but fails when running the same code in Excel for the Web. I’m using the following approach to insert worksheets from a Base64 file: const workbook = context.workbook; const…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-01-24T06:15:50.1233333+00:00
Hanthorn Jeff 85 Reputation points
commented 2026-01-26T00:58:00.72+00:00
Michelle-N 12,505 Reputation points Microsoft External Staff Moderator
1 answer One of the answers was accepted by the question author.

How to debug performance issues in Office.js add-ins running on Office desktop vs web?

I’m developing an Office JavaScript add-in and noticing significant performance differences between Office desktop and Office on the web, especially when handling large documents or frequent event callbacks. The same add-in behaves differently across…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-01-24T04:55:42.43+00:00
blom buffin 80 Reputation points
accepted 2026-01-24T16:17:32.3633333+00:00
blom buffin 80 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
edited an answer 2026-01-23T12:18:42.9566667+00:00
Steven-N 20,280 Reputation points Microsoft External Staff Moderator
1 answer One of the answers was accepted by the question author.

How to design cross-platform Excel VBA that works on both Windows and macOS?

How can Excel VBA macros be structured to run reliably on both Windows and macOS, considering platform differences such as unsupported ActiveX controls, Windows-only API calls, different file system paths, sandboxed permissions, and macro security…

Microsoft 365 and Office | Development | Office JavaScript API
asked 2026-01-22T13:12:05.1233333+00:00
Tommie Bowman 205 Reputation points
accepted 2026-01-22T15:00:27.47+00:00
Tommie Bowman 205 Reputation points
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 80 Reputation points
commented 2026-01-22T12:34:30.5533333+00:00
Dora-T 10,690 Reputation points Microsoft External Staff Moderator
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
edited an answer 2026-01-22T09:36:38.56+00:00
TiNo-T 10,820 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 91 Reputation points
commented 2026-01-16T11:58:29.3933333+00:00
Michelle-N 12,505 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 10,765 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 11,990 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 10,690 Reputation points Microsoft External Staff Moderator