Edit

Share via


Word.Interfaces.DocumentData interface

An interface describing the data returned by calling document.toJSON().

Properties

activeWindow

Gets the active window for the document.

autoHyphenation

Specifies if automatic hyphenation is turned on for the document.

autoSaveOn

Specifies if the edits in the document are automatically saved.

bibliography

Returns a Bibliography object that represents the bibliography references contained within the document.

body

Gets the body object of the main document. The body is the text that excludes headers, footers, footnotes, textboxes, etc.

changeTrackingMode

Specifies the ChangeTracking mode.

consecutiveHyphensLimit

Specifies the maximum number of consecutive lines that can end with hyphens.

contentControls

Gets the collection of content control objects in the document. This includes content controls in the body of the document, headers, footers, textboxes, etc.

customXmlParts

Gets the custom XML parts in the document.

documentLibraryVersions

Returns a DocumentLibraryVersionCollection object that represents the collection of versions of a shared document that has versioning enabled and that's stored in a document library on a server.

frames

Returns a FrameCollection object that represents all the frames in the document.

hyperlinks

Returns a HyperlinkCollection object that represents all the hyperlinks in the document.

hyphenateCaps

Specifies whether words in all capital letters can be hyphenated.

languageDetected

Specifies whether Microsoft Word has detected the language of the document text.

pageSetup

Returns a PageSetup object that's associated with the document.

properties

Gets the properties of the document.

saved

Indicates whether the changes in the document have been saved. A value of true indicates that the document hasn't changed since it was saved.

sections

Gets the collection of section objects in the document.

settings

Gets the add-in's settings in the document.

windows

Gets the collection of Word.Window objects for the document.

Property Details

activeWindow

Gets the active window for the document.

activeWindow?: Word.Interfaces.WindowData;

Property Value

Remarks

[ API set: WordApiDesktop 1.2 ]

autoHyphenation

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Specifies if automatic hyphenation is turned on for the document.

autoHyphenation?: boolean;

Property Value

boolean

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

autoSaveOn

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Specifies if the edits in the document are automatically saved.

autoSaveOn?: boolean;

Property Value

boolean

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

bibliography

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Returns a Bibliography object that represents the bibliography references contained within the document.

bibliography?: Word.Interfaces.BibliographyData;

Property Value

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

body

Gets the body object of the main document. The body is the text that excludes headers, footers, footnotes, textboxes, etc.

body?: Word.Interfaces.BodyData;

Property Value

Remarks

[ API set: WordApi 1.1 ]

changeTrackingMode

Specifies the ChangeTracking mode.

changeTrackingMode?: Word.ChangeTrackingMode | "Off" | "TrackAll" | "TrackMineOnly";

Property Value

Word.ChangeTrackingMode | "Off" | "TrackAll" | "TrackMineOnly"

Remarks

[ API set: WordApi 1.4 ]

consecutiveHyphensLimit

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Specifies the maximum number of consecutive lines that can end with hyphens.

consecutiveHyphensLimit?: number;

Property Value

number

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

contentControls

Gets the collection of content control objects in the document. This includes content controls in the body of the document, headers, footers, textboxes, etc.

contentControls?: Word.Interfaces.ContentControlData[];

Property Value

Remarks

[ API set: WordApi 1.1 ]

customXmlParts

Gets the custom XML parts in the document.

customXmlParts?: Word.Interfaces.CustomXmlPartData[];

Property Value

Remarks

[ API set: WordApi 1.4 ]

documentLibraryVersions

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Returns a DocumentLibraryVersionCollection object that represents the collection of versions of a shared document that has versioning enabled and that's stored in a document library on a server.

documentLibraryVersions?: Word.Interfaces.DocumentLibraryVersionData[];

Property Value

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

frames

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Returns a FrameCollection object that represents all the frames in the document.

frames?: Word.Interfaces.FrameData[];

Property Value

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Returns a HyperlinkCollection object that represents all the hyperlinks in the document.

hyperlinks?: Word.Interfaces.HyperlinkData[];

Property Value

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

hyphenateCaps

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Specifies whether words in all capital letters can be hyphenated.

hyphenateCaps?: boolean;

Property Value

boolean

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

languageDetected

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Specifies whether Microsoft Word has detected the language of the document text.

languageDetected?: boolean;

Property Value

boolean

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

pageSetup

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Returns a PageSetup object that's associated with the document.

pageSetup?: Word.Interfaces.PageSetupData;

Property Value

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

properties

Gets the properties of the document.

properties?: Word.Interfaces.DocumentPropertiesData;

Property Value

Remarks

[ API set: WordApi 1.3 ]

saved

Indicates whether the changes in the document have been saved. A value of true indicates that the document hasn't changed since it was saved.

saved?: boolean;

Property Value

boolean

Remarks

[ API set: WordApi 1.1 ]

sections

Gets the collection of section objects in the document.

sections?: Word.Interfaces.SectionData[];

Property Value

Remarks

[ API set: WordApi 1.1 ]

settings

Gets the add-in's settings in the document.

settings?: Word.Interfaces.SettingData[];

Property Value

Remarks

[ API set: WordApi 1.4 ]

windows

Gets the collection of Word.Window objects for the document.

windows?: Word.Interfaces.WindowData[];

Property Value

Remarks

[ API set: WordApiDesktop 1.2 ]