Edit

Share via


Word.View class

Contains the view attributes (such as show all, field shading, and table gridlines) for a window or pane.

Extends

Remarks

[ API set: WordApiDesktop 1.4 ]

Properties

areAllNonprintingCharactersDisplayed

Specifies whether all nonprinting characters are displayed.

areBackgroundsDisplayed

Gets whether background colors and images are shown when the document is displayed in print layout view.

areBookmarksIndicated

Gets whether square brackets are displayed at the beginning and end of each bookmark.

areCommentsDisplayed

Specifies whether Microsoft Word displays the comments in the document.

areConnectingLinesToRevisionsBalloonDisplayed

Specifies whether Microsoft Word displays connecting lines from the text to the revision and comment balloons.

areCropMarksDisplayed

Gets whether crop marks are shown in the corners of pages to indicate where margins are located.

areDrawingsDisplayed

Gets whether objects created with the drawing tools are displayed in print layout view.

areEditableRangesShaded

Specifies whether shading is applied to the ranges in the document that users have permission to modify.

areFieldCodesDisplayed

Specifies whether field codes are displayed.

areFormatChangesDisplayed

Specifies whether Microsoft Word displays formatting changes made to the document with Track Changes enabled.

areInkAnnotationsDisplayed

Specifies whether handwritten ink annotations are shown or hidden.

areInsertionsAndDeletionsDisplayed

Specifies whether Microsoft Word displays insertions and deletions made to the document with Track Changes enabled.

areLinesWrappedToWindow

Gets whether lines wrap at the right edge of the document window rather than at the right margin or the right column boundary.

areObjectAnchorsDisplayed

Gets whether object anchors are displayed next to items that can be positioned in print layout view.

areOptionalBreaksDisplayed

Gets whether Microsoft Word displays optional line breaks.

areOptionalHyphensDisplayed

Gets whether optional hyphens are displayed.

areOtherAuthorsVisible

Gets whether other authors' presence should be visible in the document.

arePageBoundariesDisplayed

Gets whether the top and bottom margins and the gray area between pages in the document are displayed.

areParagraphsMarksDisplayed

Gets whether paragraph marks are displayed.

arePicturePlaceholdersDisplayed

Gets whether blank boxes are displayed as placeholders for pictures.

areRevisionsAndCommentsDisplayed

Specifies whether Microsoft Word displays revisions and comments made to the document with Track Changes enabled.

areSpacesIndicated

Gets whether space characters are displayed.

areTableGridlinesDisplayed

Specifies whether table gridlines are displayed.

areTabsDisplayed

Gets whether tab characters are displayed.

areTextBoundariesDisplayed

Gets whether dotted lines are displayed around page margins, text columns, objects, and frames in print layout view.

columnWidth

Specifies the column width in Reading mode.

context

The request context associated with the object. This connects the add-in's process to the Office host application's process.

fieldShading

Gets on-screen shading for fields.

isDraft

Specifies whether all the text in a window is displayed in the same sans-serif font with minimal formatting to speed up display.

isFirstLineOnlyDisplayed

Specifies whether only the first line of body text is shown in outline view.

isFormatDisplayed

Specifies whether character formatting is visible in outline view.

isFullScreen

Specifies whether the window is in full-screen view.

isHiddenTextDisplayed

Gets whether text formatted as hidden text is displayed.

isHighlightingDisplayed

Gets whether highlight formatting is displayed and printed with the document.

isInConflictMode

Specifies whether the document is in conflict mode view.

isInPanning

Specifies whether Microsoft Word is in Panning mode.

isInReadingLayout

Specifies whether the document is being viewed in reading layout view.

isMailMergeDataView

Specifies whether mail merge data is displayed instead of mail merge fields.

isMainTextLayerVisible

Specifies whether the text in the document is visible when the header and footer areas are displayed.

isPointerShownAsMagnifier

Specifies whether the pointer is displayed as a magnifying glass in print preview.

isReadingLayoutActualView

Specifies whether pages displayed in reading layout view are displayed using the same layout as printed pages.

isXmlMarkupVisible

Specifies whether XML tags are visible in the document.

markupMode

Specifies the display mode for tracked changes.

pageColor

Specifies the page color in Reading mode.

pageMovementType

Specifies the page movement type.

readingLayoutTruncateMargins

Specifies whether margins are visible or hidden when the document is viewed in Full Screen Reading view.

revisionsBalloonSide

Gets whether Word displays revision balloons in the left or right margin in the document.

revisionsBalloonWidth

Specifies the width of the revision balloons.

revisionsBalloonWidthType

Specifies how Microsoft Word measures the width of revision balloons.

revisionsFilter

Gets the instance of a RevisionsFilter object.

seekView

Specifies the document element displayed in print layout view.

splitSpecial

Specifies the active window pane.

type

Specifies the view type.

Methods

collapseAllHeadings()

Collapses all the headings in the document.

collapseOutline(range)

Collapses the text under the selection or the specified range by one heading level.

expandAllHeadings()

Expands all the headings in the document.

expandOutline(range)

Expands the text under the selection by one heading level.

load(options)

Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.

load(propertyNames)

Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.

load(propertyNamesAndPaths)

Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.

nextHeaderFooter()

Moves to the next header or footer, depending on whether a header or footer is displayed in the view.

previousHeaderFooter()

Moves to the previous header or footer, depending on whether a header or footer is displayed in the view.

set(properties, options)

Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type.

set(properties)

Sets multiple properties on the object at the same time, based on an existing loaded object.

showAllHeadings()

Switches between showing all text (headings and body text) and showing only headings.

showHeading(level)

Shows all headings up to the specified heading level and hides subordinate headings and body text.

toJSON()

Overrides the JavaScript toJSON() method in order to provide more useful output when an API object is passed to JSON.stringify(). (JSON.stringify, in turn, calls the toJSON method of the object that's passed to it.) Whereas the original Word.View object is an API object, the toJSON method returns a plain JavaScript object (typed as Word.Interfaces.ViewData) that contains shallow copies of any loaded child properties from the original object.

track()

Track the object for automatic adjustment based on surrounding changes in the document. This call is a shorthand for context.trackedObjects.add(thisObject). If you're using this object across .sync calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you need to add the object to the tracked object collection when the object was first created. If this object is part of a collection, you should also track the parent collection.

untrack()

Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You'll need to call context.sync() before the memory release takes effect.

Property Details

areAllNonprintingCharactersDisplayed

Specifies whether all nonprinting characters are displayed.

areAllNonprintingCharactersDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areBackgroundsDisplayed

Gets whether background colors and images are shown when the document is displayed in print layout view.

areBackgroundsDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areBookmarksIndicated

Gets whether square brackets are displayed at the beginning and end of each bookmark.

readonly areBookmarksIndicated: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areCommentsDisplayed

Specifies whether Microsoft Word displays the comments in the document.

areCommentsDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areConnectingLinesToRevisionsBalloonDisplayed

Specifies whether Microsoft Word displays connecting lines from the text to the revision and comment balloons.

areConnectingLinesToRevisionsBalloonDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areCropMarksDisplayed

Gets whether crop marks are shown in the corners of pages to indicate where margins are located.

readonly areCropMarksDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areDrawingsDisplayed

Gets whether objects created with the drawing tools are displayed in print layout view.

readonly areDrawingsDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areEditableRangesShaded

Specifies whether shading is applied to the ranges in the document that users have permission to modify.

areEditableRangesShaded: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areFieldCodesDisplayed

Specifies whether field codes are displayed.

areFieldCodesDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areFormatChangesDisplayed

Specifies whether Microsoft Word displays formatting changes made to the document with Track Changes enabled.

areFormatChangesDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areInkAnnotationsDisplayed

Specifies whether handwritten ink annotations are shown or hidden.

areInkAnnotationsDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areInsertionsAndDeletionsDisplayed

Specifies whether Microsoft Word displays insertions and deletions made to the document with Track Changes enabled.

areInsertionsAndDeletionsDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areLinesWrappedToWindow

Gets whether lines wrap at the right edge of the document window rather than at the right margin or the right column boundary.

readonly areLinesWrappedToWindow: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areObjectAnchorsDisplayed

Gets whether object anchors are displayed next to items that can be positioned in print layout view.

readonly areObjectAnchorsDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areOptionalBreaksDisplayed

Gets whether Microsoft Word displays optional line breaks.

readonly areOptionalBreaksDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areOptionalHyphensDisplayed

Gets whether optional hyphens are displayed.

readonly areOptionalHyphensDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areOtherAuthorsVisible

Gets whether other authors' presence should be visible in the document.

areOtherAuthorsVisible: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

arePageBoundariesDisplayed

Gets whether the top and bottom margins and the gray area between pages in the document are displayed.

readonly arePageBoundariesDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areParagraphsMarksDisplayed

Gets whether paragraph marks are displayed.

readonly areParagraphsMarksDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

arePicturePlaceholdersDisplayed

Gets whether blank boxes are displayed as placeholders for pictures.

readonly arePicturePlaceholdersDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areRevisionsAndCommentsDisplayed

Specifies whether Microsoft Word displays revisions and comments made to the document with Track Changes enabled.

areRevisionsAndCommentsDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areSpacesIndicated

Gets whether space characters are displayed.

readonly areSpacesIndicated: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areTableGridlinesDisplayed

Specifies whether table gridlines are displayed.

areTableGridlinesDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areTabsDisplayed

Gets whether tab characters are displayed.

readonly areTabsDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

areTextBoundariesDisplayed

Gets whether dotted lines are displayed around page margins, text columns, objects, and frames in print layout view.

readonly areTextBoundariesDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

columnWidth

Specifies the column width in Reading mode.

columnWidth: Word.ColumnWidth | "Narrow" | "Default" | "Wide";

Property Value

Word.ColumnWidth | "Narrow" | "Default" | "Wide"

Remarks

[ API set: WordApiDesktop 1.4 ]

context

The request context associated with the object. This connects the add-in's process to the Office host application's process.

context: RequestContext;

Property Value

fieldShading

Gets on-screen shading for fields.

readonly fieldShading: Word.FieldShading | "Never" | "Always" | "WhenSelected";

Property Value

Word.FieldShading | "Never" | "Always" | "WhenSelected"

Remarks

[ API set: WordApiDesktop 1.4 ]

isDraft

Specifies whether all the text in a window is displayed in the same sans-serif font with minimal formatting to speed up display.

isDraft: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

isFirstLineOnlyDisplayed

Specifies whether only the first line of body text is shown in outline view.

isFirstLineOnlyDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

isFormatDisplayed

Specifies whether character formatting is visible in outline view.

isFormatDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

isFullScreen

Specifies whether the window is in full-screen view.

isFullScreen: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

isHiddenTextDisplayed

Gets whether text formatted as hidden text is displayed.

readonly isHiddenTextDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

isHighlightingDisplayed

Gets whether highlight formatting is displayed and printed with the document.

readonly isHighlightingDisplayed: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

isInConflictMode

Specifies whether the document is in conflict mode view.

isInConflictMode: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

isInPanning

Specifies whether Microsoft Word is in Panning mode.

isInPanning: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

isInReadingLayout

Specifies whether the document is being viewed in reading layout view.

isInReadingLayout: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

isMailMergeDataView

Specifies whether mail merge data is displayed instead of mail merge fields.

isMailMergeDataView: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

isMainTextLayerVisible

Specifies whether the text in the document is visible when the header and footer areas are displayed.

isMainTextLayerVisible: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

isPointerShownAsMagnifier

Specifies whether the pointer is displayed as a magnifying glass in print preview.

isPointerShownAsMagnifier: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

isReadingLayoutActualView

Specifies whether pages displayed in reading layout view are displayed using the same layout as printed pages.

isReadingLayoutActualView: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

isXmlMarkupVisible

Specifies whether XML tags are visible in the document.

isXmlMarkupVisible: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

markupMode

Specifies the display mode for tracked changes.

markupMode: Word.RevisionsMode | "Balloon" | "Inline" | "Mixed";

Property Value

Word.RevisionsMode | "Balloon" | "Inline" | "Mixed"

Remarks

[ API set: WordApiDesktop 1.4 ]

pageColor

Specifies the page color in Reading mode.

pageColor: Word.PageColor | "None" | "Sepia" | "Inverse";

Property Value

Word.PageColor | "None" | "Sepia" | "Inverse"

Remarks

[ API set: WordApiDesktop 1.4 ]

pageMovementType

Specifies the page movement type.

pageMovementType: Word.PageMovementType | "Vertical" | "SideToSide";

Property Value

Word.PageMovementType | "Vertical" | "SideToSide"

Remarks

[ API set: WordApiDesktop 1.4 ]

readingLayoutTruncateMargins

Specifies whether margins are visible or hidden when the document is viewed in Full Screen Reading view.

readingLayoutTruncateMargins: Word.ReadingLayoutMargin | "Automatic" | "Suppress" | "Full";

Property Value

Word.ReadingLayoutMargin | "Automatic" | "Suppress" | "Full"

Remarks

[ API set: WordApiDesktop 1.4 ]

revisionsBalloonSide

Gets whether Word displays revision balloons in the left or right margin in the document.

readonly revisionsBalloonSide: Word.RevisionsBalloonMargin | "Left" | "Right";

Property Value

Word.RevisionsBalloonMargin | "Left" | "Right"

Remarks

[ API set: WordApiDesktop 1.4 ]

revisionsBalloonWidth

Specifies the width of the revision balloons.

revisionsBalloonWidth: number;

Property Value

number

Remarks

[ API set: WordApiDesktop 1.4 ]

revisionsBalloonWidthType

Specifies how Microsoft Word measures the width of revision balloons.

revisionsBalloonWidthType: Word.RevisionsBalloonWidthType | "Percent" | "Points";

Property Value

Word.RevisionsBalloonWidthType | "Percent" | "Points"

Remarks

[ API set: WordApiDesktop 1.4 ]

revisionsFilter

Gets the instance of a RevisionsFilter object.

readonly revisionsFilter: Word.RevisionsFilter;

Property Value

Remarks

[ API set: WordApiDesktop 1.4 ]

seekView

Specifies the document element displayed in print layout view.

seekView: Word.SeekView | "MainDocument" | "PrimaryHeader" | "FirstPageHeader" | "EvenPagesHeader" | "PrimaryFooter" | "FirstPageFooter" | "EvenPagesFooter" | "Footnotes" | "Endnotes" | "CurrentPageHeader" | "CurrentPageFooter";

Property Value

Word.SeekView | "MainDocument" | "PrimaryHeader" | "FirstPageHeader" | "EvenPagesHeader" | "PrimaryFooter" | "FirstPageFooter" | "EvenPagesFooter" | "Footnotes" | "Endnotes" | "CurrentPageHeader" | "CurrentPageFooter"

Remarks

[ API set: WordApiDesktop 1.4 ]

splitSpecial

Specifies the active window pane.

splitSpecial: Word.SpecialPane | "None" | "PrimaryHeader" | "FirstPageHeader" | "EvenPagesHeader" | "PrimaryFooter" | "FirstPageFooter" | "EvenPagesFooter" | "Footnotes" | "Endnotes" | "FootnoteContinuationNotice" | "FootnoteContinuationSeparator" | "FootnoteSeparator" | "EndnoteContinuationNotice" | "EndnoteContinuationSeparator" | "EndnoteSeparator" | "Comments" | "CurrentPageHeader" | "CurrentPageFooter" | "Revisions" | "RevisionsHoriz" | "RevisionsVert";

Property Value

Word.SpecialPane | "None" | "PrimaryHeader" | "FirstPageHeader" | "EvenPagesHeader" | "PrimaryFooter" | "FirstPageFooter" | "EvenPagesFooter" | "Footnotes" | "Endnotes" | "FootnoteContinuationNotice" | "FootnoteContinuationSeparator" | "FootnoteSeparator" | "EndnoteContinuationNotice" | "EndnoteContinuationSeparator" | "EndnoteSeparator" | "Comments" | "CurrentPageHeader" | "CurrentPageFooter" | "Revisions" | "RevisionsHoriz" | "RevisionsVert"

Remarks

[ API set: WordApiDesktop 1.4 ]

type

Specifies the view type.

type: Word.ViewType | "Normal" | "Outline" | "Print" | "PrintPreview" | "Master" | "Web" | "Reading" | "Conflict";

Property Value

Word.ViewType | "Normal" | "Outline" | "Print" | "PrintPreview" | "Master" | "Web" | "Reading" | "Conflict"

Remarks

[ API set: WordApiDesktop 1.4 ]

Method Details

collapseAllHeadings()

Collapses all the headings in the document.

collapseAllHeadings(): void;

Returns

void

Remarks

[ API set: WordApiDesktop 1.4 ]

collapseOutline(range)

Collapses the text under the selection or the specified range by one heading level.

collapseOutline(range: Word.Range): void;

Parameters

range
Word.Range

A Range object that specifies the range to collapse.

Returns

void

Remarks

[ API set: WordApiDesktop 1.4 ]

expandAllHeadings()

Expands all the headings in the document.

expandAllHeadings(): void;

Returns

void

Remarks

[ API set: WordApiDesktop 1.4 ]

expandOutline(range)

Expands the text under the selection by one heading level.

expandOutline(range: Word.Range): void;

Parameters

range
Word.Range

A Range object that specifies the range to expand.

Returns

void

Remarks

[ API set: WordApiDesktop 1.4 ]

load(options)

Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.

load(options?: Word.Interfaces.ViewLoadOptions): Word.View;

Parameters

options
Word.Interfaces.ViewLoadOptions

Provides options for which properties of the object to load.

Returns

load(propertyNames)

Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.

load(propertyNames?: string | string[]): Word.View;

Parameters

propertyNames

string | string[]

A comma-delimited string or an array of strings that specify the properties to load.

Returns

load(propertyNamesAndPaths)

Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.

load(propertyNamesAndPaths?: {
            select?: string;
            expand?: string;
        }): Word.View;

Parameters

propertyNamesAndPaths

{ select?: string; expand?: string; }

propertyNamesAndPaths.select is a comma-delimited string that specifies the properties to load, and propertyNamesAndPaths.expand is a comma-delimited string that specifies the navigation properties to load.

Returns

nextHeaderFooter()

Moves to the next header or footer, depending on whether a header or footer is displayed in the view.

nextHeaderFooter(): void;

Returns

void

Remarks

[ API set: WordApiDesktop 1.4 ]

previousHeaderFooter()

Moves to the previous header or footer, depending on whether a header or footer is displayed in the view.

previousHeaderFooter(): void;

Returns

void

Remarks

[ API set: WordApiDesktop 1.4 ]

set(properties, options)

Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type.

set(properties: Interfaces.ViewUpdateData, options?: OfficeExtension.UpdateOptions): void;

Parameters

properties
Word.Interfaces.ViewUpdateData

A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called.

options
OfficeExtension.UpdateOptions

Provides an option to suppress errors if the properties object tries to set any read-only properties.

Returns

void

set(properties)

Sets multiple properties on the object at the same time, based on an existing loaded object.

set(properties: Word.View): void;

Parameters

properties
Word.View

Returns

void

showAllHeadings()

Switches between showing all text (headings and body text) and showing only headings.

showAllHeadings(): void;

Returns

void

Remarks

[ API set: WordApiDesktop 1.4 ]

showHeading(level)

Shows all headings up to the specified heading level and hides subordinate headings and body text.

showHeading(level: number): void;

Parameters

level

number

The heading level to show.

Returns

void

Remarks

[ API set: WordApiDesktop 1.4 ]

toJSON()

Overrides the JavaScript toJSON() method in order to provide more useful output when an API object is passed to JSON.stringify(). (JSON.stringify, in turn, calls the toJSON method of the object that's passed to it.) Whereas the original Word.View object is an API object, the toJSON method returns a plain JavaScript object (typed as Word.Interfaces.ViewData) that contains shallow copies of any loaded child properties from the original object.

toJSON(): Word.Interfaces.ViewData;

Returns

track()

Track the object for automatic adjustment based on surrounding changes in the document. This call is a shorthand for context.trackedObjects.add(thisObject). If you're using this object across .sync calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you need to add the object to the tracked object collection when the object was first created. If this object is part of a collection, you should also track the parent collection.

track(): Word.View;

Returns

untrack()

Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You'll need to call context.sync() before the memory release takes effect.

untrack(): Word.View;

Returns