Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CoercionType enumeration

CoercionType enumeration (JavaScript API for Office)

Office Add-ins

Specifies how to coerce data returned or set by the invoked method.

Last modified: August 07, 2015

Note Note

The name "apps for Office" is changing to "Office Add-ins". During the transition, the documentation and the UI of some Office host applications and Visual Studio tools might still use the term "apps for Office". For details, see New name for apps for Office and SharePoint.

Hosts:

Access, Excel, Outlook, PowerPoint, Project, Word

Last changed in Mailbox

1.1

See all support details

Office.CoercionType

Values

Enumeration

Value

Description

Office.CoercionType.Html

"html"

Return or set data as HTML.

Note Note

Only applies to data in add-ins for Word and mail add-ins for Outlook (compose mode).

Office.CoercionType.Matrix

"matrix"

Return or set data as tabular data with no headers.

Data is returned or set as an array of arrays containing one-dimensional runs of characters. For example, three rows of string values in two columns would be: [["R1C1", "R1C2"], ["R2C1", "R2C2"], ["R3C1", "R3C2"]].

Note Note

Only applies to data in Excel and Word.

Office.CoercionType.Ooxml

"ooxml"

Return or set data as Office Open XML.

Note Note

Only applies to data in Word.

Office.CoercionType.SlideRange

"slideRange"

Return a JSON object that contains an array of the ids, titles, and indexes of the selected slides.

For example, {"slides":[{"id":257,"title":"Slide 2","index":2},{"id":256,"title":"Slide 1","index":1}]} for a selection of two slides.

Note Note

Only applies to data in PowerPoint when calling the Document.getSelectedData method to get the current slide or selected range of slides.

Office.CoercionType.Table

"table"

Return or set data as tabular data with optional headers.

Data is returned or set as an array of arrays with optional headers.

Note Note

Only applies to data in Access, Excel and Word.

Office.CoercionType.Text

"text"

Return or set data as text (string).

Data is returned or set as a one-dimensional run of characters.

PowerPoint supports only Office.CoercionType.Text and Office.CoercionType.SlideRange.

Project supports only Office.CoercionType.Text.

A checkmark (√) in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration.

For more information about Office host application and server requirements, see Requirements for running Office Add-ins.

Supported hosts, by platform

Office for Windows desktop

Office Online
(in browser)

Office for iPad

OWA for Devices

Office for Mac

Access

Excel

Outlook

PowerPoint

Project

Word

Add-in types

Content, mail (compose mode), task pane

Library

Office.js

Namespace

Office

Version

Changes

1.1

Added support for Word Online.

1.1

Added support for Excel and Word in Office for iPad.

1.1

Added support for add-ins for Access.

1.1

Added support for compose mode mail add-ins.

1.0

Introduced

Show:
© 2015 Microsoft