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. |
relative |
The relative horizontal position of the shape. For a floating shape, it can't be set. |
relative |
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
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
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
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
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
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
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
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
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
Office Add-ins