Word.Interfaces.ShapeData interface

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

Properties

body

Represents the body object of the shape. Only applies to TextBox shapes.

height

The height, in points, of the shape.

id

Gets an integer that represents the shape identifier.

left

The distance, in points, from the left side of the shape to the horizontal relative position. For a floating shape, it will return 0 and can't be set.

relativeHorizontalPosition

The relative horizontal position of the shape. For a floating shape, it can't be set.

relativeVerticalPosition

The relative vertical position of the shape. For a floating shape, it can't be set.

top

The distance, in points, from the top edge of the shape to the vertical relative position. For a floating shape, it will return 0 and can't be set.

type

Gets the shape type. Currently, only TextBox shapes are supported.

width

The width, in points, of the shape.

Property Details

body

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.

Represents the body object of the shape. Only applies to TextBox shapes.

body?: Word.Interfaces.BodyData;

Property Value

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

height

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.

The height, in points, of the shape.

height?: number;

Property Value

number

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

id

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.

Gets an integer that represents the shape identifier.

id?: number;

Property Value

number

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

left

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.

The distance, in points, from the left side of the shape to the horizontal relative position. For a floating shape, it will return 0 and can't be set.

left?: number;

Property Value

number

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

relativeHorizontalPosition

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.

The relative horizontal position of the shape. For a floating shape, it can't be set.

relativeHorizontalPosition?: Word.RelativeHorizontalPosition | "Margin" | "Page" | "Column" | "Character" | "LeftMargin" | "RightMargin" | "InsideMargin" | "OutsideMargin";

Property Value

Word.RelativeHorizontalPosition | "Margin" | "Page" | "Column" | "Character" | "LeftMargin" | "RightMargin" | "InsideMargin" | "OutsideMargin"

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

relativeVerticalPosition

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.

The relative vertical position of the shape. For a floating shape, it can't be set.

relativeVerticalPosition?: Word.RelativeVerticalPosition | "Margin" | "Page" | "Paragraph" | "Line" | "TopMargin" | "BottomMargin" | "InsideMargin" | "OutsideMargin";

Property Value

Word.RelativeVerticalPosition | "Margin" | "Page" | "Paragraph" | "Line" | "TopMargin" | "BottomMargin" | "InsideMargin" | "OutsideMargin"

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

top

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.

The distance, in points, from the top edge of the shape to the vertical relative position. For a floating shape, it will return 0 and can't be set.

top?: number;

Property Value

number

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

type

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.

Gets the shape type. Currently, only TextBox shapes are supported.

type?: Word.ShapeType | "Unsupported" | "TextBox";

Property Value

Word.ShapeType | "Unsupported" | "TextBox"

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

width

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.

The width, in points, of the shape.

width?: number;

Property Value

number

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]