Pi_1452's avatar
Pi_1452
Occasional Reader
Jul 15, 2026
Status:
New

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:

  1. A unified cross-host anchor abstraction
  2. Persistent anchor identifiers
  3. Selection, session, document, and manual lifetime modes
  4. Preview, interactive, and editor interaction modes
  5. Sandboxed iframe or WebView content
  6. Automatic viewport-aware placement
  7. Host-managed repositioning during scrolling, zooming, layout changes, or document reflow
  8. Explicit print, PDF export, image export, and presentation rendering policies
  9. Message passing between the Office Add-in runtime and the contextual surface
  10. 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.

No CommentsBe the first to comment