What's new in Word JavaScript API 1.1

WordApi 1.1 is the first requirement set of the Word JavaScript API. It's the only Word API requirement set supported by Word 2016.

API list

The following table lists the APIs in Word JavaScript API requirement set 1.1. To view API reference documentation for all APIs supported by Word JavaScript API requirement set 1.1, see Word APIs in requirement set 1.1.

Class Fields Description
Body clear() Clears the contents of the body object.
contentControls Gets the collection of rich text content control objects in the body.
font Gets the text format of the body.
getHtml() Gets an HTML representation of the body object.
getOoxml() Gets the OOXML (Office Open XML) representation of the body object.
ignorePunct
ignoreSpace
inlinePictures Gets the collection of InlinePicture objects in the body.
insertBreak(breakType: Word.BreakType, insertLocation: Word.InsertLocation) Inserts a break at the specified location in the main document.
insertContentControl() Wraps the body object with a Rich Text content control.
insertFileFromBase64(base64File: string, insertLocation: Word.InsertLocation) Inserts a document into the body at the specified location.
insertHtml(html: string, insertLocation: Word.InsertLocation) Inserts HTML at the specified location.
insertOoxml(ooxml: string, insertLocation: Word.InsertLocation) Inserts OOXML at the specified location.
insertParagraph(paragraphText: string, insertLocation: Word.InsertLocation) Inserts a paragraph at the specified location.
insertText(text: string, insertLocation: Word.InsertLocation) Inserts text into the body at the specified location.
matchCase
matchPrefix
matchSuffix
matchWholeWord
matchWildcards
paragraphs Gets the collection of paragraph objects in the body.
parentContentControl Gets the content control that contains the body.
search(searchText: string, searchOptions?: Word.SearchOptions | { ignorePunct?: boolean ignoreSpace?: boolean matchCase?: boolean matchPrefix?: boolean matchSuffix?: boolean matchWholeWord?: boolean matchWildcards?: boolean }) Performs a search with the specified SearchOptions on the scope of the body object.
select(selectionMode?: Word.SelectionMode) Selects the body and navigates the Word UI to it.
style Gets or sets the style name for the body.
text Gets the text of the body.
ContentControl appearance Gets or sets the appearance of the content control.
cannotDelete Gets or sets a value that indicates whether the user can delete the content control.
cannotEdit Gets or sets a value that indicates whether the user can edit the contents of the content control.
clear() Clears the contents of the content control.
color Gets or sets the color of the content control.
contentControls Gets the collection of content control objects in the content control.
delete(keepContent: boolean) Deletes the content control and its content.
font Gets the text format of the content control.
getHtml() Gets an HTML representation of the content control object.
getOoxml() Gets the Office Open XML (OOXML) representation of the content control object.
id Gets an integer that represents the content control identifier.
ignorePunct
ignoreSpace
inlinePictures Gets the collection of inlinePicture objects in the content control.
insertBreak(breakType: Word.BreakType, insertLocation: Word.InsertLocation) Inserts a break at the specified location in the main document.
insertFileFromBase64(base64File: string, insertLocation: Word.InsertLocation) Inserts a document into the content control at the specified location.
insertHtml(html: string, insertLocation: Word.InsertLocation) Inserts HTML into the content control at the specified location.
insertOoxml(ooxml: string, insertLocation: Word.InsertLocation) Inserts OOXML into the content control at the specified location.
insertParagraph(paragraphText: string, insertLocation: Word.InsertLocation) Inserts a paragraph at the specified location.
insertText(text: string, insertLocation: Word.InsertLocation) Inserts text into the content control at the specified location.
matchCase
matchPrefix
matchSuffix
matchWholeWord
matchWildcards
paragraphs Gets the collection of paragraph objects in the content control.
parentContentControl Gets the content control that contains the content control.
placeholderText Gets or sets the placeholder text of the content control.
removeWhenEdited Gets or sets a value that indicates whether the content control is removed after it is edited.
search(searchText: string, searchOptions?: Word.SearchOptions | { ignorePunct?: boolean ignoreSpace?: boolean matchCase?: boolean matchPrefix?: boolean matchSuffix?: boolean matchWholeWord?: boolean matchWildcards?: boolean }) Performs a search with the specified SearchOptions on the scope of the content control object.
select(selectionMode?: Word.SelectionMode) Selects the content control.
style Gets or sets the style name for the content control.
tag Gets or sets a tag to identify a content control.
text Gets the text of the content control.
title Gets or sets the title for a content control.
type Gets the content control type.
ContentControlCollection getById(id: number) Gets a content control by its identifier.
getByTag(tag: string) Gets the content controls that have the specified tag.
getByTitle(title: string) Gets the content controls that have the specified title.
getItem(index: number) Gets a content control by its index in the collection.
items Gets the loaded child items in this collection.
Document body Gets the body object of the main document.
contentControls Gets the collection of content control objects in the document.
getSelection() Gets the current selection of the document.
save() Saves the document.
saved Indicates whether the changes in the document have been saved.
sections Gets the collection of section objects in the document.
Font bold Gets or sets a value that indicates whether the font is bold.
color Gets or sets the color for the specified font.
doubleStrikeThrough Gets or sets a value that indicates whether the font has a double strikethrough.
highlightColor Gets or sets the highlight color.
italic Gets or sets a value that indicates whether the font is italicized.
name Gets or sets a value that represents the name of the font.
size Gets or sets a value that represents the font size in points.
strikeThrough Gets or sets a value that indicates whether the font has a strikethrough.
subscript Gets or sets a value that indicates whether the font is a subscript.
superscript Gets or sets a value that indicates whether the font is a superscript.
underline Gets or sets a value that indicates the font's underline type.
InlinePicture altTextDescription Gets or sets a string that represents the alternative text associated with the inline image.
altTextTitle Gets or sets a string that contains the title for the inline image.
getBase64ImageSrc() Gets the base64 encoded string representation of the inline image.
height Gets or sets a number that describes the height of the inline image.
hyperlink Gets or sets a hyperlink on the image.
insertContentControl() Wraps the inline picture with a rich text content control.
lockAspectRatio Gets or sets a value that indicates whether the inline image retains its original proportions when you resize it.
parentContentControl Gets the content control that contains the inline image.
width Gets or sets a number that describes the width of the inline image.
InlinePictureCollection items Gets the loaded child items in this collection.
Paragraph alignment Gets or sets the alignment for a paragraph.
clear() Clears the contents of the paragraph object.
contentControls Gets the collection of content control objects in the paragraph.
delete() Deletes the paragraph and its content from the document.
firstLineIndent Gets or sets the value, in points, for a first line or hanging indent.
font Gets the text format of the paragraph.
getHtml() Gets an HTML representation of the paragraph object.
getOoxml() Gets the Office Open XML (OOXML) representation of the paragraph object.
ignorePunct
ignoreSpace
inlinePictures Gets the collection of InlinePicture objects in the paragraph.
insertBreak(breakType: Word.BreakType, insertLocation: Word.InsertLocation) Inserts a break at the specified location in the main document.
insertContentControl() Wraps the paragraph object with a rich text content control.
insertFileFromBase64(base64File: string, insertLocation: Word.InsertLocation) Inserts a document into the paragraph at the specified location.
insertHtml(html: string, insertLocation: Word.InsertLocation) Inserts HTML into the paragraph at the specified location.
insertInlinePictureFromBase64(base64EncodedImage: string, insertLocation: Word.InsertLocation) Inserts a picture into the paragraph at the specified location.
insertOoxml(ooxml: string, insertLocation: Word.InsertLocation) Inserts OOXML into the paragraph at the specified location.
insertParagraph(paragraphText: string, insertLocation: Word.InsertLocation) Inserts a paragraph at the specified location.
insertText(text: string, insertLocation: Word.InsertLocation) Inserts text into the paragraph at the specified location.
leftIndent Gets or sets the left indent value, in points, for the paragraph.
lineSpacing Gets or sets the line spacing, in points, for the specified paragraph.
lineUnitAfter Gets or sets the amount of spacing, in grid lines, after the paragraph.
lineUnitBefore Gets or sets the amount of spacing, in grid lines, before the paragraph.
matchCase
matchPrefix
matchSuffix
matchWholeWord
matchWildcards
outlineLevel Gets or sets the outline level for the paragraph.
parentContentControl Gets the content control that contains the paragraph.
rightIndent Gets or sets the right indent value, in points, for the paragraph.
search(searchText: string, searchOptions?: Word.SearchOptions | { ignorePunct?: boolean ignoreSpace?: boolean matchCase?: boolean matchPrefix?: boolean matchSuffix?: boolean matchWholeWord?: boolean matchWildcards?: boolean }) Performs a search with the specified SearchOptions on the scope of the paragraph object.
select(selectionMode?: Word.SelectionMode) Selects and navigates the Word UI to the paragraph.
spaceAfter Gets or sets the spacing, in points, after the paragraph.
spaceBefore Gets or sets the spacing, in points, before the paragraph.
style Gets or sets the style name for the paragraph.
text Gets the text of the paragraph.
ParagraphCollection items Gets the loaded child items in this collection.
Range clear() Clears the contents of the range object.
contentControls Gets the collection of content control objects in the range.
delete() Deletes the range and its content from the document.
font Gets the text format of the range.
getHtml() Gets an HTML representation of the range object.
getOoxml() Gets the OOXML representation of the range object.
ignorePunct
ignoreSpace
insertBreak(breakType: Word.BreakType, insertLocation: Word.InsertLocation) Inserts a break at the specified location in the main document.
insertContentControl() Wraps the range object with a rich text content control.
insertFileFromBase64(base64File: string, insertLocation: Word.InsertLocation) Inserts a document at the specified location.
insertHtml(html: string, insertLocation: Word.InsertLocation) Inserts HTML at the specified location.
insertOoxml(ooxml: string, insertLocation: Word.InsertLocation) Inserts OOXML at the specified location.
insertParagraph(paragraphText: string, insertLocation: Word.InsertLocation) Inserts a paragraph at the specified location.
insertText(text: string, insertLocation: Word.InsertLocation) Inserts text at the specified location.
matchCase
matchPrefix
matchSuffix
matchWholeWord
matchWildcards
paragraphs Gets the collection of paragraph objects in the range.
parentContentControl Gets the content control that contains the range.
search(searchText: string, searchOptions?: Word.SearchOptions | { ignorePunct?: boolean ignoreSpace?: boolean matchCase?: boolean matchPrefix?: boolean matchSuffix?: boolean matchWholeWord?: boolean matchWildcards?: boolean }) Performs a search with the specified SearchOptions on the scope of the range object.
select(selectionMode?: Word.SelectionMode) Selects and navigates the Word UI to the range.
style Gets or sets the style name for the range.
text Gets the text of the range.
RangeCollection items Gets the loaded child items in this collection.
SearchOptions ignorePunct Gets or sets a value that indicates whether to ignore all punctuation characters between words.
ignoreSpace Gets or sets a value that indicates whether to ignore all whitespace between words.
matchCase Gets or sets a value that indicates whether to perform a case sensitive search.
matchPrefix Gets or sets a value that indicates whether to match words that begin with the search string.
matchSuffix Gets or sets a value that indicates whether to match words that end with the search string.
matchWholeWord Gets or sets a value that indicates whether to find operation only entire words, not text that is part of a larger word.
matchWildcards Gets or sets a value that indicates whether the search will be performed using special search operators.
Section body Gets the body object of the section.
getFooter(type: Word.HeaderFooterType) Gets one of the section's footers.
getHeader(type: Word.HeaderFooterType) Gets one of the section's headers.
SectionCollection items Gets the loaded child items in this collection.

See also