1,116 questions with Microsoft 365 and Office | Development | Office JavaScript API tags
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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…