office add-ins ux
82 TopicsImplement Office.context.mailbox.item.getAsFileAsync for draft messages
We have a requirement in an Office.js add-in to do the following: Automatically send a message Save the sent message The functionality was previously implemented using EWS and Office.context.mailbox.getCallbackTokenAsync. However, both are being phased out. Office.auth.getAccessToken is supposed to replace Office.context.mailbox.getCallbackTokenAsync, but we did not manage to get it to work in my add-in. To send the mail, Office.context.mailbox.item.sendAsync is now available, but it currently does not allow to execute code after sending. So we want to collect the draft before sending and process it in the back-end of our web app. We are hindered here by the fact that Office.context.mailbox.item.getAsFileAsync cannot be used on a draft. The function is currently not available for a draft message, we get the error message `Office.context.mailbox.item.getAsFileAsync is not a function` when trying to use it. The same works fine for messages in other Outlook folders like Inbox or Sent Items. To assemble eml-like text for the draft message so that we can save it in the back end of our add-in requires quite a lot of code. Also, img nodes reference external content, e.g., they have a src like `src="https://attachments.office.net/owa/.../service.svc/s/GetAttachmentThumbnail?id=` with id being a base64 string, where an eml should have `src="cid:` with cid referencing to a short id of a mime part in the same eml. There is no straightforward way to resolve all images when building an eml client-side.Support split-button controls in add-in ribbon commands (parity with VSTO)
Office Add-ins (Office.js) currently do not support a split-button control in custom ribbon commands. VSTO/COM add-ins have long supported split-Button (a primary action button combined with a dropdown of related actions), but the add-in command model only offers Button and Menu control types. This is a significant gap for teams migrating VSTO solutions to Office.js. Current behavior In both the XML manifest and the unified manifest, add-in commands support: Button: executes a single action or opens a task pane Menu: a dropdown that lists actions, but the top-level control itself cannot execute an action There is no control that combines both behaviors. Expected behavior Provide a Split-Button control type that: Has a primary button portion that executes a default action (function command or show task pane) when clicked. Has an arrow/dropdown portion that opens a menu of related items. Optionally allows the default action to be updated at runtime (for example, the last-used item becomes the default, like the Font Color and Highlight buttons in Word and Excel). Works with existing contextual tab and dynamic ribbon APIs (Office.ribbon.requestUpdate) for enabling/disabling the control and its items. Why this matters VSTO migration parity: many enterprise VSTO add-ins rely on split buttons. Without them, migrated UIs need extra buttons or menus that add clicks and break familiar workflows. Ribbon space: split buttons group related commands without consuming extra ribbon space. Consistency with Office UI: built-in commands (Paste, Font Color, Insert Table, etc.) use split buttons extensively, and add-ins cannot match that native look and feel. Current workarounds and their drawbacks Separate Button + Menu: takes twice the space and doesn't look or behave like a native split button. Menu only: requires an extra click for the most common action. Task pane UI: moves commands out of the ribbon, which is worse for frequent actions. Platforms: Office on Windows, Office on Mac, Office on the web Applications: Excel, Word, PowerPoint, Outlook References Add-in commands docs: https://learn.microsoft.com/office/dev/add-ins/design/add-in-commands VSTO Ribbon XML: https://learn.microsoft.com/visualstudio/vsto/ribbon-xml49Views0likes0CommentsWord on Mac: bring Range.insertText() performance in line with Windows and Web
Summary Word.Range.insertText(text, "Replace") followed by context.sync() takes ~300 ms on Word for Mac desktop, versus ~4.5 ms on Windows and ~16 ms on Word on the web running on the same Mac. Full repro and measurements: OfficeDev/office-js#6721. Why it matters The cost is per round trip, not per character, so it scales with the number of edits. Add-ins that apply many individual range replacements — proofreading, terminology enforcement, review passes, template population — are fast on Windows and unusable on Mac from the exact same codebase. We build a writing-assistance add-in where a single correction pass means hundreds of replacements, and this gap is what currently prevents us from shipping it to our Mac users. Why we don't think this is expected behaviour This was filed as a bug and we were told it's by design and belongs here as an idea. We'd like to challenge that: Word on the web, in a browser, on the very same Mac, is roughly 19x faster than the native Mac host. That rules out hardware, macOS, and the general cost of the Office.js bridge, and points at the Mac host's insert/sync round trip specifically. What we're asking for Bring Range.insertText() round-trip latency on Mac into the same order of magnitude as Windows and the web. Failing that, publish the supported pattern for applying many replacements on Mac without paying the per-sync()cost. Document the current Mac performance characteristics in the Office.js docs.Office.js API Request: Context-Anchored Sandboxed Web Surfaces for Excel, Word, and PowerPoint
Office Add-ins currently provide cross-platform task panes, dialogs, and add-in commands. However, developers cannot display sandboxed and interactive web content anchored to a selected document object without inserting a native shape, image, text box, content control, or other persistent Office object. I propose a cross-platform Context-Anchored Web Surface API for Excel, Word, and PowerPoint. The API should allow an Office Add-in to attach a sandboxed web card to the current selection or to a supported document object, including: Excel ranges, table cells, charts, images, or shapes Word text ranges, paragraphs, table cells, images, or content controls PowerPoint text ranges, shapes, images, table cells, or slides The surface should not become part of the native document drawing layer unless the developer explicitly requests conversion to a document object. Office should manage: Position relative to the anchor Focus and keyboard interaction Security boundaries Z-order and clipping Scrolling and zoom behavior Word document reflow PowerPoint editing and presentation modes Surface lifetime and restoration Cross-platform behavior The proposed API should provide: A unified cross-host anchor abstraction Persistent anchor identifiers Selection, session, document, and manual lifetime modes Preview, interactive, and editor interaction modes Sandboxed iframe or WebView content Automatic viewport-aware placement Host-managed repositioning during scrolling, zooming, layout changes, or document reflow Explicit print, PDF export, image export, and presentation rendering policies Message passing between the Office Add-in runtime and the contextual surface Requirement-set detection across Windows, macOS, Office on the web, and supported mobile clients An example API could look like: Office.context.ui.contextualSurfaces.create({ anchor: Office.context.document.getSelectionAnchor(), source: { url: “https://example.com/context-card” }, placement: { preferred: “right”, keepInViewport: true, followAnchor: true }, interaction: { mode: “interactive”, dismissOnEscape: true }, lifetime: { mode: “document”, restoreOnOpen: true }, rendering: { mode: “authoringOnly”, includeInPrint: false, includeInExport: false } }); This would enable contextual experiences such as: Chemical compound and molecular structure cards Biomedical annotations Citation and literature tools Translation and terminology previews Financial and company data cards Educational explanations AI-assisted review tools Domain-specific document annotations Today, developers must choose between a fixed task pane and native document objects. A host-managed contextual web surface would provide a secure and consistent middle layer while preserving document integrity and cross-platform compatibility.77Views0likes0CommentsSupport custom functions downstream of iterative (circular) calculation - currently return #CALC!
Office.js custom functions in Excel return #CALC! whenever any of their precedents involve a circular reference chain resolved by iterative calculation, even when the function itself is not part of the loop. (Tracked in https://github.com/OfficeDev/office-js/issues/4738, open since July 2024.) Many common financial usecases require iterative calculations as part of standard practices. As an example, average-balance interest with iterative calculation is the mainstream convention in leveraged-finance modeling. Interest expense depends on the average debt balance, which depends on cash paydown, which depends on interest expense. Analysts across banking and private equity resolve this loop with Excel's iterative calculation setting. The same pattern appears in revolver/cash-sweep modeling and fund fee/NAV calculations. These workbooks worked for decades with XLL and VBA UDFs. Any custom function consuming a model's outputs (e.g. an add-in function that writes results back to an external platform) is by definition downstream of the circular chain, so it always fails in these models. We've verified: a custom function with literal arguments works; the same function with an argument fed from the converged loop returns #CALC!; severing the dependency with IF(TRUE, value, FN(...)) makes it work again. This blocks migration from legacy XLL/VBA add-ins to the modern Custom Functions API for financial-modeling users. The ask: custom functions downstream of a circular chain should evaluate against the loop's converged values after the iteration pass completes — matching legacy XLL/VBA UDF behavior. Custom functions don't need to participate in the iteration itself.Show "Loading add-in" before the task pane web app is available
Product Office.js / Outlook Classic (Task Pane Add-ins) Problem Description When a task pane add-in is opened in Outlook Classic, there can be a significant delay before the add-in's web application is displayed. During this phase, users often see a blank or empty task pane without any indication that the add-in is still loading. Based on our observations, this delay frequently occurs before the add-in page itself is loaded and before any JavaScript code can be executed. The startup time appears to be heavily influenced by the underlying Chromium/WebView network initialization and page-loading process. As add-in developers, we currently have no opportunity to provide feedback to the user during this early loading phase because the web application has not yet started executing. User Impact A blank task pane creates the impression that: Outlook has frozen. The add-in has crashed. The add-in failed to load. The user needs to close and reopen the add-in. This leads to confusion, unnecessary support requests, and a poor user experience, especially in environments with slow network conditions, security software, proxy servers, or delayed WebView initialization. Proposed Enhancement Provide a native Outlook-hosted loading screen that is displayed immediately when the task pane is opened and remains visible until the add-in page has started loading successfully. Example messages: "Preparing add-in..." "Loading add-in..." "Initializing add-in environment..." The loading screen could optionally include: A progress indicator or spinner. Diagnostic information for troubleshooting. A timeout message if loading exceeds a configurable threshold. Alternative Proposal Expose an API that allows developers to define static HTML content that Outlook can display before the actual add-in page is loaded. Since displaying simple HTML content is possible without waiting for the complete network stack and WebView page initialization, this would allow developers to provide immediate visual feedback while the Chromium/WebView infrastructure is still preparing the add-in. Benefits Improved user experience. Reduced perception of application hangs. Fewer support tickets related to slow add-in startup. Better transparency during WebView initialization. Improved reliability perception for Office Add-ins in enterprise environments. Environment Outlook Classic for Windows Office.js Task Pane Add-ins Chromium-based WebView runtime The issue is most noticeable in environments where WebView initialization or network-related startup operations are delayed.Outlook 365 for Mobile app - Compose window support for Office JS add-ins
We are exploring the new Office JS add-ons model for Outlook for mobile apps and wanted to integrate our product with iOS/Android apps. While exploring the new Office JS model, we didn't see any way to integrate the product with compose window. Task-pane or commandBar way of integration is missing for compose window. Compose window task-pane or commandBar integration is common use case among iOS/Android users. While composing emails, the following use cases are common in industry: Users want to insert documents or attach emails from 3rd part repository or storage or from content management software. When user sends an email, they want to keep a copy of the email in the repository also Currently these use cases are not possible with add-in model. But it is supported in desktop version as well as web version of add-ins. Without these use cases support, users wont adapt our solutions. So this is required for more user adaptability.No programmatic way to pin the task pane for users
Your Environment Platform: PC desktop, Mac, Office on the web Host: Outlook Office version number: All supported versions Operating System: Windows, macOS Expected behavior The Office JS API should provide a programmatic mechanism to pin the task pane on behalf of the user — for example, via a manifest setting or a runtime API call — so that the task pane remains open and pinned without requiring manual action from each user. Current behavior There is no programmatic way to pin the task pane for users. Users must pin it manually via the UI. This results in an inconsistent experience, particularly for enterprise deployments where we need to ensure the add-in remains accessible without relying on individual user action. Context We need the task pane to remain pinned for all users automatically upon install or first launch. The current lack of a programmatic pin mechanism creates friction and support overhead, as users frequently close the task pane and do not know how to re-pin it. We are looking for either an existing API we may have missed, or confirmation that this is a platform gap so we can raise a feature request through the appropriate channel.Support for Split Button in ribbon
We need a way to declare a split button (an action button with a drop down menu accessible by clicking the down arrow next to the button. (like. the Flags split menu in Outlook (button can clear the flag while dropdown menu can select a flag). The manifest could be a menu with an ExecuteFunction at the item level. If an execute function is present, the rendering is a Split-Button otherwise it's a classic menu. A example taken from New Outlook for MacOS. The split button exists, but it's unavailable to office.js add-ins.Gracefully handle unavailability of Office.js
The reliance on Office.js (and its dependencies) delivered from the network proves to be challenging in some scenarios. While ideally the platform would support full offline use, I'm hopeful that there are some incremental improvements that could be made to address some of our challenges in the shorter term. As an example, our add-in hooks into Outlook's OnMessageSend, which inherently puts it on the critical path of the user experience when sending emails. In scenarios where the user's network is slow or unreliable, or in an event of an Azure CDN outage that makes Office.js unavailable or slow to be delivered, the user experiences a long wait while Office.js is loaded on message send. I should highlight that Outlook attributes this delay to the add-in: "Add-in X is taking longer than expected". I'd like to propose that the platform gives the add-in more control over the user experience in these cases. What this would look like for our OnMessageSend add-in is that the add-in would execute some code outside of the event handler (before Office.js finishes loading) to start a timer, and if the loading phase exceeds a timeout value defined in the add-in code then the add-in would instruct Outlook to conclude the processing of the event (similarly to how event.completed() is invoked inside an event handler). That last part would require some interface with Outlook that is available even if Office.js hasn't been fully loaded.124Views1like0Comments