Edit

Share via


Word.FillFormat class

Represents the fill formatting for a shape or text.

Extends

Remarks

[ API set: WordApiDesktop 1.3 ]

Properties

backgroundColor

Returns a ColorFormat object that represents the background color for the fill.

context

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

foregroundColor

Returns a ColorFormat object that represents the foreground color for the fill.

gradientAngle

Specifies the angle of the gradient fill. The valid range of values is from 0 to 359.9.

gradientColorType

Gets the gradient color type.

gradientDegree

Returns how dark or light a one-color gradient fill is. A value of 0 means that black is mixed in with the shape's foreground color to form the gradient. A value of 1 means that white is mixed in. Values between 0 and 1 mean that a darker or lighter shade of the foreground color is mixed in.

gradientStyle

Returns the gradient style for the fill.

gradientVariant

Returns the gradient variant for the fill as an integer value from 1 to 4 for most gradient fills.

isVisible

Specifies if the object, or the formatting applied to it, is visible.

pattern

Returns a PatternType value that represents the pattern applied to the fill or line.

presetGradientType

Returns the preset gradient type for the fill.

presetTexture

Gets the preset texture.

rotateWithObject

Specifies whether the fill rotates with the shape.

textureAlignment

Specifies the alignment (the origin of the coordinate grid) for the tiling of the texture fill.

textureHorizontalScale

Specifies the horizontal scaling factor for the texture fill.

textureName

Returns the name of the custom texture file for the fill.

textureOffsetX

Specifies the horizontal offset of the texture from the origin in points.

textureOffsetY

Specifies the vertical offset of the texture.

textureTile

Specifies whether the texture is tiled.

textureType

Returns the texture type for the fill.

textureVerticalScale

Specifies the vertical scaling factor for the texture fill as a value between 0.0 and 1.0.

transparency

Specifies the degree of transparency of the fill for a shape as a value between 0.0 (opaque) and 1.0 (clear).

type

Gets the fill format type.

Methods

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.

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.

setOneColorGradient(style, variant, degree)

Sets the fill to a one-color gradient.

setOneColorGradient(style, variant, degree)

Sets the fill to a one-color gradient.

setPatterned(pattern)

Sets the fill to a pattern.

setPatterned(pattern)

Sets the fill to a pattern.

setPresetGradient(style, variant, presetGradientType)

Sets the fill to a preset gradient. The gradient style.The gradient variant. Can be a value from 1 to 4.The preset gradient type.

setPresetGradient(style, variant, presetGradientType)

Sets the fill to a preset gradient. The gradient style.The gradient variant. Can be a value from 1 to 4.The preset gradient type.

setPresetTextured(presetTexture)

Sets the fill to a preset texture.

setPresetTextured(presetTexture)

Sets the fill to a preset texture.

setTwoColorGradient(style, variant)

Sets the fill to a two-color gradient.

setTwoColorGradient(style, variant)

Sets the fill to a two-color gradient.

solid()

Sets the fill to a uniform color.

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.FillFormat object is an API object, the toJSON method returns a plain JavaScript object (typed as Word.Interfaces.FillFormatData) 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

backgroundColor

Returns a ColorFormat object that represents the background color for the fill.

readonly backgroundColor: Word.ColorFormat;

Property Value

Remarks

[ API set: WordApiDesktop 1.3 ]

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

foregroundColor

Returns a ColorFormat object that represents the foreground color for the fill.

readonly foregroundColor: Word.ColorFormat;

Property Value

Remarks

[ API set: WordApiDesktop 1.3 ]

gradientAngle

Specifies the angle of the gradient fill. The valid range of values is from 0 to 359.9.

gradientAngle: number;

Property Value

number

Remarks

[ API set: WordApiDesktop 1.3 ]

gradientColorType

Gets the gradient color type.

readonly gradientColorType: Word.GradientColorType | "Mixed" | "OneColor" | "TwoColors" | "PresetColors" | "MultiColor";

Property Value

Word.GradientColorType | "Mixed" | "OneColor" | "TwoColors" | "PresetColors" | "MultiColor"

Remarks

[ API set: WordApiDesktop 1.3 ]

gradientDegree

Returns how dark or light a one-color gradient fill is. A value of 0 means that black is mixed in with the shape's foreground color to form the gradient. A value of 1 means that white is mixed in. Values between 0 and 1 mean that a darker or lighter shade of the foreground color is mixed in.

readonly gradientDegree: number;

Property Value

number

Remarks

[ API set: WordApiDesktop 1.3 ]

gradientStyle

Returns the gradient style for the fill.

readonly gradientStyle: Word.GradientStyle | "Mixed" | "Horizontal" | "Vertical" | "DiagonalUp" | "DiagonalDown" | "FromCorner" | "FromTitle" | "FromCenter";

Property Value

Word.GradientStyle | "Mixed" | "Horizontal" | "Vertical" | "DiagonalUp" | "DiagonalDown" | "FromCorner" | "FromTitle" | "FromCenter"

Remarks

[ API set: WordApiDesktop 1.3 ]

gradientVariant

Returns the gradient variant for the fill as an integer value from 1 to 4 for most gradient fills.

readonly gradientVariant: number;

Property Value

number

Remarks

[ API set: WordApiDesktop 1.3 ]

isVisible

Specifies if the object, or the formatting applied to it, is visible.

isVisible: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.3 ]

pattern

Returns a PatternType value that represents the pattern applied to the fill or line.

readonly pattern: Word.PatternType | "Mixed" | "Percent5" | "Percent10" | "Percent20" | "Percent25" | "Percent30" | "Percent40" | "Percent50" | "Percent60" | "Percent70" | "Percent75" | "Percent80" | "Percent90" | "DarkHorizontal" | "DarkVertical" | "DarkDownwardDiagonal" | "DarkUpwardDiagonal" | "SmallCheckerBoard" | "Trellis" | "LightHorizontal" | "LightVertical" | "LightDownwardDiagonal" | "LightUpwardDiagonal" | "SmallGrid" | "DottedDiamond" | "WideDownwardDiagonal" | "WideUpwardDiagonal" | "DashedUpwardDiagonal" | "DashedDownwardDiagonal" | "NarrowVertical" | "NarrowHorizontal" | "DashedVertical" | "DashedHorizontal" | "LargeConfetti" | "LargeGrid" | "HorizontalBrick" | "LargeCheckerBoard" | "SmallConfetti" | "ZigZag" | "SolidDiamond" | "DiagonalBrick" | "OutlinedDiamond" | "Plaid" | "Sphere" | "Weave" | "DottedGrid" | "Divot" | "Shingle" | "Wave" | "Horizontal" | "Vertical" | "Cross" | "DownwardDiagonal" | "UpwardDiagonal" | "DiagonalCross";

Property Value

Word.PatternType | "Mixed" | "Percent5" | "Percent10" | "Percent20" | "Percent25" | "Percent30" | "Percent40" | "Percent50" | "Percent60" | "Percent70" | "Percent75" | "Percent80" | "Percent90" | "DarkHorizontal" | "DarkVertical" | "DarkDownwardDiagonal" | "DarkUpwardDiagonal" | "SmallCheckerBoard" | "Trellis" | "LightHorizontal" | "LightVertical" | "LightDownwardDiagonal" | "LightUpwardDiagonal" | "SmallGrid" | "DottedDiamond" | "WideDownwardDiagonal" | "WideUpwardDiagonal" | "DashedUpwardDiagonal" | "DashedDownwardDiagonal" | "NarrowVertical" | "NarrowHorizontal" | "DashedVertical" | "DashedHorizontal" | "LargeConfetti" | "LargeGrid" | "HorizontalBrick" | "LargeCheckerBoard" | "SmallConfetti" | "ZigZag" | "SolidDiamond" | "DiagonalBrick" | "OutlinedDiamond" | "Plaid" | "Sphere" | "Weave" | "DottedGrid" | "Divot" | "Shingle" | "Wave" | "Horizontal" | "Vertical" | "Cross" | "DownwardDiagonal" | "UpwardDiagonal" | "DiagonalCross"

Remarks

[ API set: WordApiDesktop 1.3 ]

presetGradientType

Returns the preset gradient type for the fill.

readonly presetGradientType: Word.PresetGradientType | "Mixed" | "EarlySunset" | "LateSunset" | "Nightfall" | "Daybreak" | "Horizon" | "Desert" | "Ocean" | "CalmWater" | "Fire" | "Fog" | "Moss" | "Peacock" | "Wheat" | "Parchment" | "Mahogany" | "Rainbow" | "RainbowII" | "Gold" | "GoldII" | "Brass" | "Chrome" | "ChromeII" | "Silver" | "Sapphire";

Property Value

Word.PresetGradientType | "Mixed" | "EarlySunset" | "LateSunset" | "Nightfall" | "Daybreak" | "Horizon" | "Desert" | "Ocean" | "CalmWater" | "Fire" | "Fog" | "Moss" | "Peacock" | "Wheat" | "Parchment" | "Mahogany" | "Rainbow" | "RainbowII" | "Gold" | "GoldII" | "Brass" | "Chrome" | "ChromeII" | "Silver" | "Sapphire"

Remarks

[ API set: WordApiDesktop 1.3 ]

presetTexture

Gets the preset texture.

readonly presetTexture: Word.PresetTexture | "Mixed" | "Papyrus" | "Canvas" | "Denim" | "WovenMat" | "WaterDroplets" | "PaperBag" | "FishFossil" | "Sand" | "GreenMarble" | "WhiteMarble" | "BrownMarble" | "Granite" | "Newsprint" | "RecycledPaper" | "Parchment" | "Stationery" | "BlueTissuePaper" | "PinkTissuePaper" | "PurpleMesh" | "Bouquet" | "Cork" | "Walnut" | "Oak" | "MediumWood";

Property Value

Word.PresetTexture | "Mixed" | "Papyrus" | "Canvas" | "Denim" | "WovenMat" | "WaterDroplets" | "PaperBag" | "FishFossil" | "Sand" | "GreenMarble" | "WhiteMarble" | "BrownMarble" | "Granite" | "Newsprint" | "RecycledPaper" | "Parchment" | "Stationery" | "BlueTissuePaper" | "PinkTissuePaper" | "PurpleMesh" | "Bouquet" | "Cork" | "Walnut" | "Oak" | "MediumWood"

Remarks

[ API set: WordApiDesktop 1.3 ]

rotateWithObject

Specifies whether the fill rotates with the shape.

rotateWithObject: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.3 ]

textureAlignment

Specifies the alignment (the origin of the coordinate grid) for the tiling of the texture fill.

textureAlignment: Word.TextureAlignment | "Mixed" | "TopLeft" | "Top" | "TopRight" | "Left" | "Center" | "Right" | "BottomLeft" | "Bottom" | "BottomRight";

Property Value

Word.TextureAlignment | "Mixed" | "TopLeft" | "Top" | "TopRight" | "Left" | "Center" | "Right" | "BottomLeft" | "Bottom" | "BottomRight"

Remarks

[ API set: WordApiDesktop 1.3 ]

textureHorizontalScale

Specifies the horizontal scaling factor for the texture fill.

textureHorizontalScale: number;

Property Value

number

Remarks

[ API set: WordApiDesktop 1.3 ]

textureName

Returns the name of the custom texture file for the fill.

readonly textureName: string;

Property Value

string

Remarks

[ API set: WordApiDesktop 1.3 ]

textureOffsetX

Specifies the horizontal offset of the texture from the origin in points.

textureOffsetX: number;

Property Value

number

Remarks

[ API set: WordApiDesktop 1.3 ]

textureOffsetY

Specifies the vertical offset of the texture.

textureOffsetY: number;

Property Value

number

Remarks

[ API set: WordApiDesktop 1.3 ]

textureTile

Specifies whether the texture is tiled.

textureTile: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.3 ]

textureType

Returns the texture type for the fill.

readonly textureType: Word.TextureType | "Mixed" | "Preset" | "UserDefined";

Property Value

Word.TextureType | "Mixed" | "Preset" | "UserDefined"

Remarks

[ API set: WordApiDesktop 1.3 ]

textureVerticalScale

Specifies the vertical scaling factor for the texture fill as a value between 0.0 and 1.0.

textureVerticalScale: number;

Property Value

number

Remarks

[ API set: WordApiDesktop 1.3 ]

transparency

Specifies the degree of transparency of the fill for a shape as a value between 0.0 (opaque) and 1.0 (clear).

transparency: number;

Property Value

number

Remarks

[ API set: WordApiDesktop 1.3 ]

type

Gets the fill format type.

readonly type: Word.FillType | "Mixed" | "Solid" | "Patterned" | "Gradient" | "Textured" | "Background" | "Picture";

Property Value

Word.FillType | "Mixed" | "Solid" | "Patterned" | "Gradient" | "Textured" | "Background" | "Picture"

Remarks

[ API set: WordApiDesktop 1.3 ]

Method Details

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.FillFormatLoadOptions): Word.FillFormat;

Parameters

options
Word.Interfaces.FillFormatLoadOptions

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.FillFormat;

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.FillFormat;

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

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.FillFormatUpdateData, options?: OfficeExtension.UpdateOptions): void;

Parameters

properties
Word.Interfaces.FillFormatUpdateData

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.FillFormat): void;

Parameters

properties
Word.FillFormat

Returns

void

setOneColorGradient(style, variant, degree)

Sets the fill to a one-color gradient.

setOneColorGradient(style: Word.GradientStyle, variant: number, degree: number): void;

Parameters

style
Word.GradientStyle

The gradient style.

variant

number

The gradient variant. Can be a value from 1 to 4.

degree

number

The gradient degree. Can be a value from 0.0 (dark) to 1.0 (light).

Returns

void

Remarks

[ API set: WordApiDesktop 1.3 ]

setOneColorGradient(style, variant, degree)

Sets the fill to a one-color gradient.

setOneColorGradient(style: "Mixed" | "Horizontal" | "Vertical" | "DiagonalUp" | "DiagonalDown" | "FromCorner" | "FromTitle" | "FromCenter", variant: number, degree: number): void;

Parameters

style

"Mixed" | "Horizontal" | "Vertical" | "DiagonalUp" | "DiagonalDown" | "FromCorner" | "FromTitle" | "FromCenter"

The gradient style.

variant

number

The gradient variant. Can be a value from 1 to 4.

degree

number

The gradient degree. Can be a value from 0.0 (dark) to 1.0 (light).

Returns

void

Remarks

[ API set: WordApiDesktop 1.3 ]

setPatterned(pattern)

Sets the fill to a pattern.

setPatterned(pattern: Word.PatternType): void;

Parameters

Returns

void

Remarks

[ API set: WordApiDesktop 1.3 ]

setPatterned(pattern)

Sets the fill to a pattern.

setPatterned(pattern: "Mixed" | "Percent5" | "Percent10" | "Percent20" | "Percent25" | "Percent30" | "Percent40" | "Percent50" | "Percent60" | "Percent70" | "Percent75" | "Percent80" | "Percent90" | "DarkHorizontal" | "DarkVertical" | "DarkDownwardDiagonal" | "DarkUpwardDiagonal" | "SmallCheckerBoard" | "Trellis" | "LightHorizontal" | "LightVertical" | "LightDownwardDiagonal" | "LightUpwardDiagonal" | "SmallGrid" | "DottedDiamond" | "WideDownwardDiagonal" | "WideUpwardDiagonal" | "DashedUpwardDiagonal" | "DashedDownwardDiagonal" | "NarrowVertical" | "NarrowHorizontal" | "DashedVertical" | "DashedHorizontal" | "LargeConfetti" | "LargeGrid" | "HorizontalBrick" | "LargeCheckerBoard" | "SmallConfetti" | "ZigZag" | "SolidDiamond" | "DiagonalBrick" | "OutlinedDiamond" | "Plaid" | "Sphere" | "Weave" | "DottedGrid" | "Divot" | "Shingle" | "Wave" | "Horizontal" | "Vertical" | "Cross" | "DownwardDiagonal" | "UpwardDiagonal" | "DiagonalCross"): void;

Parameters

pattern

"Mixed" | "Percent5" | "Percent10" | "Percent20" | "Percent25" | "Percent30" | "Percent40" | "Percent50" | "Percent60" | "Percent70" | "Percent75" | "Percent80" | "Percent90" | "DarkHorizontal" | "DarkVertical" | "DarkDownwardDiagonal" | "DarkUpwardDiagonal" | "SmallCheckerBoard" | "Trellis" | "LightHorizontal" | "LightVertical" | "LightDownwardDiagonal" | "LightUpwardDiagonal" | "SmallGrid" | "DottedDiamond" | "WideDownwardDiagonal" | "WideUpwardDiagonal" | "DashedUpwardDiagonal" | "DashedDownwardDiagonal" | "NarrowVertical" | "NarrowHorizontal" | "DashedVertical" | "DashedHorizontal" | "LargeConfetti" | "LargeGrid" | "HorizontalBrick" | "LargeCheckerBoard" | "SmallConfetti" | "ZigZag" | "SolidDiamond" | "DiagonalBrick" | "OutlinedDiamond" | "Plaid" | "Sphere" | "Weave" | "DottedGrid" | "Divot" | "Shingle" | "Wave" | "Horizontal" | "Vertical" | "Cross" | "DownwardDiagonal" | "UpwardDiagonal" | "DiagonalCross"

Returns

void

Remarks

[ API set: WordApiDesktop 1.3 ]

setPresetGradient(style, variant, presetGradientType)

Sets the fill to a preset gradient. The gradient style.The gradient variant. Can be a value from 1 to 4.The preset gradient type.

setPresetGradient(style: Word.GradientStyle, variant: number, presetGradientType: Word.PresetGradientType): void;

Parameters

variant

number

presetGradientType
Word.PresetGradientType

Returns

void

Remarks

[ API set: WordApiDesktop 1.3 ]

setPresetGradient(style, variant, presetGradientType)

Sets the fill to a preset gradient. The gradient style.The gradient variant. Can be a value from 1 to 4.The preset gradient type.

setPresetGradient(style: "Mixed" | "Horizontal" | "Vertical" | "DiagonalUp" | "DiagonalDown" | "FromCorner" | "FromTitle" | "FromCenter", variant: number, presetGradientType: "Mixed" | "EarlySunset" | "LateSunset" | "Nightfall" | "Daybreak" | "Horizon" | "Desert" | "Ocean" | "CalmWater" | "Fire" | "Fog" | "Moss" | "Peacock" | "Wheat" | "Parchment" | "Mahogany" | "Rainbow" | "RainbowII" | "Gold" | "GoldII" | "Brass" | "Chrome" | "ChromeII" | "Silver" | "Sapphire"): void;

Parameters

style

"Mixed" | "Horizontal" | "Vertical" | "DiagonalUp" | "DiagonalDown" | "FromCorner" | "FromTitle" | "FromCenter"

variant

number

presetGradientType

"Mixed" | "EarlySunset" | "LateSunset" | "Nightfall" | "Daybreak" | "Horizon" | "Desert" | "Ocean" | "CalmWater" | "Fire" | "Fog" | "Moss" | "Peacock" | "Wheat" | "Parchment" | "Mahogany" | "Rainbow" | "RainbowII" | "Gold" | "GoldII" | "Brass" | "Chrome" | "ChromeII" | "Silver" | "Sapphire"

Returns

void

Remarks

[ API set: WordApiDesktop 1.3 ]

setPresetTextured(presetTexture)

Sets the fill to a preset texture.

setPresetTextured(presetTexture: Word.PresetTexture): void;

Parameters

presetTexture
Word.PresetTexture

Returns

void

Remarks

[ API set: WordApiDesktop 1.3 ]

setPresetTextured(presetTexture)

Sets the fill to a preset texture.

setPresetTextured(presetTexture: "Mixed" | "Papyrus" | "Canvas" | "Denim" | "WovenMat" | "WaterDroplets" | "PaperBag" | "FishFossil" | "Sand" | "GreenMarble" | "WhiteMarble" | "BrownMarble" | "Granite" | "Newsprint" | "RecycledPaper" | "Parchment" | "Stationery" | "BlueTissuePaper" | "PinkTissuePaper" | "PurpleMesh" | "Bouquet" | "Cork" | "Walnut" | "Oak" | "MediumWood"): void;

Parameters

presetTexture

"Mixed" | "Papyrus" | "Canvas" | "Denim" | "WovenMat" | "WaterDroplets" | "PaperBag" | "FishFossil" | "Sand" | "GreenMarble" | "WhiteMarble" | "BrownMarble" | "Granite" | "Newsprint" | "RecycledPaper" | "Parchment" | "Stationery" | "BlueTissuePaper" | "PinkTissuePaper" | "PurpleMesh" | "Bouquet" | "Cork" | "Walnut" | "Oak" | "MediumWood"

Returns

void

Remarks

[ API set: WordApiDesktop 1.3 ]

setTwoColorGradient(style, variant)

Sets the fill to a two-color gradient.

setTwoColorGradient(style: Word.GradientStyle, variant: number): void;

Parameters

variant

number

Returns

void

Remarks

[ API set: WordApiDesktop 1.3 ]

setTwoColorGradient(style, variant)

Sets the fill to a two-color gradient.

setTwoColorGradient(style: "Mixed" | "Horizontal" | "Vertical" | "DiagonalUp" | "DiagonalDown" | "FromCorner" | "FromTitle" | "FromCenter", variant: number): void;

Parameters

style

"Mixed" | "Horizontal" | "Vertical" | "DiagonalUp" | "DiagonalDown" | "FromCorner" | "FromTitle" | "FromCenter"

variant

number

Returns

void

Remarks

[ API set: WordApiDesktop 1.3 ]

solid()

Sets the fill to a uniform color.

solid(): void;

Returns

void

Remarks

[ API set: WordApiDesktop 1.3 ]

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.FillFormat object is an API object, the toJSON method returns a plain JavaScript object (typed as Word.Interfaces.FillFormatData) that contains shallow copies of any loaded child properties from the original object.

toJSON(): Word.Interfaces.FillFormatData;

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.FillFormat;

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.FillFormat;

Returns