Office Add-ins documentation
23 TopicsTags can't be exported / imported for slides using .exportBase64().
As can be seen in https://github.com/OfficeDev/office-js/issues/5989 https://github.com/OfficeDev/office-js/issues/6104 Tags on Powerpoint Slides/Shapes/Presentation currently are not exported or imported when running exportBase64 on a slide, essentially killing a very large part of the functionality that they would otherwise enable. It would be great if this could be added soon 🙏.Ability to Assign Custom Properties or Unique IDs to Individual Cells
Summary I'd like to request support for assigning custom metadata — such as unique IDs or arbitrary key-value pairs — directly to individual cells in Excel using the Office.js API. Why This Matters Currently, developers must rely on workarounds like named ranges, hidden metadata sheets, or cell notes to simulate per-cell identifiers. These approaches are either limited, fragile, or not scalable for large applications. Native support for cell-level metadata would unlock powerful use cases: Dynamic form builders Cell-level validation engines Workflow tracking Data lineage and audit trails Integration with external systems via stable cell references Proposed API Concept range.customProperties.add("id", "cell_001"); const id = range.customProperties.getItem("id").value; Or even: range.metadata = { id: "cell_001", status: "approved", validator: "admin" }; Benefits Eliminates reliance on fragile naming conventions Enables scalable, structured metadata management Improves developer experience and app robustness Alternatives Considered Named ranges: limited and global scope Notes/comments: visible to users, not structured Hidden metadata sheets: hard to maintain Custom XML parts: complex and not cell-specific Request Please consider adding support for cell-level metadata or custom properties in a future version of Office.js. Even a lightweight key-value store per cell would be a game-changer.596Views99likes2CommentsFeature Request: Add error/rejection support to Office.onReady() for network/dependency failures
Description Currently, when Office.js loads but one of its dependent resources (such as office_strings.js) fails to load due to network issues or blocking, the Office.onReady() promise never resolves or rejects. This leaves developers without a reliable way to detect missing dependencies. Instead of relying on timeouts or log messages, it would be very helpful if Office.onReady() provided an error callback or rejection in these scenarios. Why this matters: Helps developers handle production failures gracefully. Avoids arbitrary timeouts/workarounds to detect missing dependencies. Provides parity with modern async practices where promises resolve or reject deterministically. Enables better telemetry/analytics by explicitly knowing why initialization failed. Suggested Approach: If a required dependency fails to load, Office.onReady() should reject with an error describing the missing dependency. Alternatively, provide an event/callback (e.g., Office.onError) that developers can subscribe to. Example: Office.onReady() .then(info => { console.log("Office.js initialized:", info); }) .catch(err => { console.error("Office.js failed to initialize:", err); // custom fallback handling }); Impact: This would improve developer experience significantly and make add-ins more resilient in real-world network environments.Add viewportChanged event to Word JavaScript API
In Word add-ins, we often need to react to changes in the user's viewport (scrolling, zooming, etc.). Currently, there's no event to detect when the visible pages change. A viewportChanged event on Word.Pane or Word.Window would allow developers to optimize performance and create dynamic experiences based on what the user is viewing.215Views72likes0CommentsLimitation with Static AppDomain Entries in Office Add-in Manifest
As outlined in the [Microsoft documentation](https://learn.microsoft.com/en-us/javascript/api/manifest/appdomain), trusted domains must be explicitly declared in the Office Add-in manifest using the <AppDomain> element. A trusted domain allows: - Pages, routes, or other resources in that domain to be opened directly in the root task pane on desktop Office platforms (note: this does not apply to Office on the web or dialog APIs). - Pages in that domain to make Office.js API calls from IFrames within the add-in. We are currently developing a first-party native Excel Add-in as part of a strategic partnership. However, our architecture requires support for customer-specific subdomains, such as: ``` <AppDomain>https://customer1.company.com</AppDomain> <AppDomain>https://customer2.company.com</AppDomain> <AppDomain>https://customer3.company.com</AppDomain> <AppDomain>https://customer4.company.com</AppDomain> ``` This list is dynamically growing, making it infeasible to maintain a static list of subdomains in the manifest. Each manifest update would require re-submission through AppSource, creating significant operational overhead and slowing down delivery. Because of this limitation, we’re forced to distribute customer-specific manifests and rely on M365 tenant admins to install the add-in manually—introducing friction and reducing discoverability for users. We propose enabling wildcard support for <AppDomain> entries in the manifest, e.g.: ``` <AppDomain>https://*.company.com</AppDomain> ``` This would allow all subdomains under company.com to be trusted without requiring individual enumeration, simplifying deployment and scaling while preserving security. This limitation has been highlighted and highly upvoted by the developer community in the following feature requests: - https://techcommunity.microsoft.com/idea/microsoft365developerplatform/add-in-manifest-allow-wildcards-for-app-domains/4162573 - https://techcommunity.microsoft.com/idea/microsoft365developerplatform/support-wildcards-for-appdomains-in-office-add-in-manifests-to-support-sub-domai/2312326Programmatically set the cursor (caret) to a specific location in an e-mail
Describe your scenario We are writing an addin for One Outlook where we place a signature text in the body of an e-mail. What is the problem to solve? The signature text we are placing is added correctly, but the cursor (caret) is placed at the bottom of the inserted text. We would like to control where the cursor (caret) is placed after we inserted the text. We have tried the following ideas: Using setSelectedDataAsync to dynamically insert content immediately after the marker. Manipulating the HTML with getAsync and setAsync to simulate the desired cursor position. Adding selectable elements, such as a span with a zero-width space, to force the cursor to position itself at the marker. Using prependAsync to insert content at the beginning of the body as an alternative to controlling the cursor. Implementing JavaScript methods like this: function setCaret() { var el = document.getElementById("editable"); var range = document.createRange(); var sel = window.getSelection(); range.setStart(el.childNodes[2], 5); range.collapse(true); sel.removeAllRanges(); sel.addRange(range); } Which APIs or add-in features? We are using Office.JS, see https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/insert-data-in-the-body#insert-data-at-the-current-cursor-position We have asked this question https://github.com/OfficeDev/office-js-docs-pr/issues/5188 , but this feature isn't available. Can this feature be added? There is a more or less similar question here.Smart alerts: Add handling for Send anyway and don't send buttons
Many add-ins have migrated to using the new smart alerts feature, primarily because it offers a non-blocking experience for users when an add-in encounters an issue. However, this migration has introduced a significant limitation: Smart alerts do not provide the same level of control that traditional dialog-based flows did, especially in scenarios where the add-in needs to know whether an email was sent or not. In the previous model, add-ins could handle "Send" or "Don't Send" actions explicitly, but smart alerts currently offer no event hooks for these actions. This poses a challenge for add-ins that depend on tracking whether a message was actually sent, as there is no reliable way to determine the outcome of the user’s decision. Suggested improvements (Implement one of these): 1. Add event handling for “Send Anyway” and “Don’t Send” buttons Introduce the ability for add-ins to register a callback function that is triggered after a user clicks either the Send Anyway or Don’t Send button. This callback should not allow UI interaction (e.g. showing dialogs or alerts) but should give the add-in a chance to log or process the outcome silently. 2. Allow send mode override from prompt user to soft block Allow the add-ins to switch the send mode from prompt user to soft block (Currently only the opposite is possible). In this model: If the add-in is unreachable, the user is not blocked and can proceed. If the add-in is reachable, it can control the send operation (leveraging the existing taskpane-based send flow).104Views4likes0CommentsAutomated NLP conversational agent production, with Office, without writing code
I have developed a solution which allows people to create Natural Language conversational agents, using MS Office and VBA, without writing any line of code. The method starts with MS Word. The integrated VBA code extract patterns from Docx documents. MS Excel get back these patterns and through its VBA capabilities, produce after few clicks (fully automated process) a Graphed Conversational Agent that I can query in Natural Language to find the right answer : from MS word documents to MS Excel queries in few clicks. I plan also to automate another use case which is Text Analytics document comparizon.Support for Inserting Media Elements via PowerPoint.ShapeCollection.addMediaElement API
We are developing a PowerPoint Office.js add-in and would like to request enhanced API support for working with media files (such as audio and video) in presentations. Currently, the PowerPoint JavaScript API allows us to insert text boxes via the following method: addTextBox(text, options): PowerPoint.Shape This is extremely helpful for managing text-based content, but there is no equivalent method for adding media files programmatically. Proposed Enhancement We suggest extending the PowerPoint.ShapeCollection class with a new method: addMediaElement(mediaUrl, options?): PowerPoint.Shape Parameters: mediaUrl (string): The publicly accessible or base64-encoded URL to the media file. options (object, optional): Additional options such as: mediaType: "audio" | "video" left, top, height, width: Placement and sizing of the media on the slide. autoplay: boolean loop: boolean Returns: A PowerPoint.Shape object representing the inserted media file (video/audio), allowing further manipulation (e.g., move, resize, delete). Use Case: In our add-in, we dynamically generate slide content based on user input, and part of that workflow includes inserting media. Currently, we are blocked by the lack of a native API method to insert video/audio. We believe this functionality would be extremely valuable for a wide range of educational, corporate, and accessibility-related add-ins. Thank you for considering this enhancement to the PowerPoint JavaScript API.Extend Support for Border Manipulation Properties in Word Online
Hello Team, We are developing an Office Add-in that manipulates style border properties (e.g., outsideBorderType, outsideBorderWidth, and outsideBorderColor) to customize table and paragraph formatting in Word. Our testing shows that when running our code on the desktop version of Word these properties are populated and function as expected. However, when executing the same code in Word Online, the aforementioned border properties remain undefined. Reference to Documentation: We followed the guidelines provided in the Word.BorderCollection documentation, which indicates that this functionality is part of the [API set: WordApiDesktop 1.1]. Request for Clarification: Are these border manipulation properties intended to be supported in Word Online? If they are currently unsupported, are there any plans to extend this functionality to the online environment? Alternatively, if this behavior is unintended or represents a bug, could you provide guidance or recommended workarounds? Additional References and Test Project: To further illustrate the issue, we have prepared videos and screenshots demonstrating the differing behavior between Word Desktop and Word Online: https://informationmappingintl-my.sharepoint.com/:v:/g/personal/ranisimov_informationmapping_com/EVwCDvJkZ4ZNgn5Ug3ZD4cMBAlsPn77WfDavRVnQJSzWkQ?e=BOXcg1&nav=eyJwbGF5YmFja09wdGlvbnMiOnt9LCJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJUZWFtcyIsInJlZmVycmFsTW9kZSI6InZpZXciLCJyZWZlcnJhbFZpZXciOiJwb3N0cm9sbC1jb3B5bGluayIsInJlZmVycmFsUGxheWJhY2tTZXNzaW9uSWQiOiI1MjYyNWYzMy1kNjU5LTQzNjUtOGQzMy0wYWVmMjY4NmM1NzIifX0%3D https://informationmappingintl-my.sharepoint.com/:v:/g/personal/ranisimov_informationmapping_com/EQhtUTEZT2xEuwWohnBWJQwBxssR9B_JCKZlS3nqrRftiQ?e=3P6dh8&nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJTdHJlYW1XZWJBcHAiLCJyZWZlcnJhbFZpZXciOiJTaGFyZURpYWxvZy1MaW5rIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXcifX0%3D Additionally, we have attached a test project (https://informationmappingintl-my.sharepoint.com/:u:/g/personal/ranisimov_informationmapping_com/EbxiR6xkYAZEjLn9JEMpd6gBYwuYK9gFGS9445-nx2OfUA?e=iZ3ycY) that reproduces the issue. To run the test project: Open the project in Visual Studio Code. Run npm install in the terminal. Run npm start. Thank you for your time and assistance. We look forward to your feedback, as resolving this issue would help ensure a consistent experience for our users across all platforms. Sincerely, Bart