Word.Interfaces.ShapeData interface
An interface describing the data returned by calling shape.toJSON()
.
Properties
allow |
Specifies whether a given shape can overlap other shapes. |
alt |
Specifies a string that represents the alternative text associated with the shape. |
body | Represents the body object of the shape. Only applies to text boxes and geometric shapes. |
canvas | Gets the canvas associated with the shape. An object with its |
fill | Returns the fill formatting of the shape. |
geometric |
The geometric shape type of the shape. It will be null if isn't a geometric shape. |
height | The height, in points, of the shape. |
height |
The percentage of shape height to vertical relative size, see Word.RelativeSize. For an inline or child shape, it can't be set. |
id | Gets an integer that represents the shape identifier. |
is |
Check whether this shape is a child of a group shape or a canvas shape. |
left | The distance, in points, from the left side of the shape to the horizontal relative position, see Word.RelativeHorizontalPosition. For an inline shape, it will return 0 and can't be set. For a child shape in a canvas or group, it's relative to the top left corner. |
left |
The relative left position as a percentage from the left side of the shape to the horizontal relative position, see Word.RelativeHorizontalPosition. For an inline or child shape, it will return 0 and can't be set. |
lock |
Specifies if the aspect ratio of this shape is locked. |
name | The name of the shape. |
parent |
Gets the top-level parent canvas shape of this child shape. It will be null if it isn't a child shape of a canvas. |
parent |
Gets the top-level parent group shape of this child shape. It will be null if it isn't a child shape of a group. |
relative |
The relative horizontal position of the shape. For an inline shape, it can't be set. For details, see Word.RelativeHorizontalPosition. |
relative |
The relative horizontal size of the shape. For an inline or child shape, it can't be set. For details, see Word.RelativeHorizontalPosition. |
relative |
The relative vertical position of the shape. For an inline shape, it can't be set. For details, see Word.RelativeVerticalPosition. |
relative |
The relative vertical size of the shape. For an inline or child shape, it can't be set. For details, see Word.RelativeHorizontalPosition. |
rotation | Specifies the rotation, in degrees, of the shape. Not applicable to Canvas shape. |
shape |
Gets the shape group associated with the shape. An object with its |
text |
Gets the text frame object of the shape. |
text |
Returns the text wrap formatting of the shape. |
top | The distance, in points, from the top edge of the shape to the vertical relative position, see Word.RelativeVerticalPosition. For an inline shape, it will return 0 and can't be set. For a child shape in a canvas or group, it's relative to the top left corner. |
top |
The relative top position as a percentage from the top edge of the shape to the vertical relative position, see Word.RelativeVerticalPosition. For an inline or child shape, it will return 0 and can't be set. |
type | Gets the shape type. Currently, only the following shapes are supported: text boxes, geometric shapes, groups, pictures, and canvases. |
visible | Specifies if the shape is visible. Not applicable to inline shapes. |
width | The width, in points, of the shape. |
width |
The percentage of shape width to horizontal relative size, see Word.RelativeSize. For an inline or child shape, it can't be set. |
Property Details
allowOverlap
Specifies whether a given shape can overlap other shapes.
allowOverlap?: boolean;
Property Value
boolean
Remarks
altTextDescription
Specifies a string that represents the alternative text associated with the shape.
altTextDescription?: string;
Property Value
string
Remarks
body
Represents the body object of the shape. Only applies to text boxes and geometric shapes.
body?: Word.Interfaces.BodyData;
Property Value
Remarks
canvas
Gets the canvas associated with the shape. An object with its isNullObject
property set to true
will be returned if the shape type isn't "Canvas". For further information, see *OrNullObject methods and properties.
canvas?: Word.Interfaces.CanvasData;
Property Value
Remarks
fill
Returns the fill formatting of the shape.
fill?: Word.Interfaces.ShapeFillData;
Property Value
Remarks
geometricShapeType
The geometric shape type of the shape. It will be null if isn't a geometric shape.
geometricShapeType?: Word.GeometricShapeType | "LineInverse" | "Triangle" | "RightTriangle" | "Rectangle" | "Diamond" | "Parallelogram" | "Trapezoid" | "NonIsoscelesTrapezoid" | "Pentagon" | "Hexagon" | "Heptagon" | "Octagon" | "Decagon" | "Dodecagon" | "Star4" | "Star5" | "Star6" | "Star7" | "Star8" | "Star10" | "Star12" | "Star16" | "Star24" | "Star32" | "RoundRectangle" | "Round1Rectangle" | "Round2SameRectangle" | "Round2DiagonalRectangle" | "SnipRoundRectangle" | "Snip1Rectangle" | "Snip2SameRectangle" | "Snip2DiagonalRectangle" | "Plaque" | "Ellipse" | "Teardrop" | "HomePlate" | "Chevron" | "PieWedge" | "Pie" | "BlockArc" | "Donut" | "NoSmoking" | "RightArrow" | "LeftArrow" | "UpArrow" | "DownArrow" | "StripedRightArrow" | "NotchedRightArrow" | "BentUpArrow" | "LeftRightArrow" | "UpDownArrow" | "LeftUpArrow" | "LeftRightUpArrow" | "QuadArrow" | "LeftArrowCallout" | "RightArrowCallout" | "UpArrowCallout" | "DownArrowCallout" | "LeftRightArrowCallout" | "UpDownArrowCallout" | "QuadArrowCallout" | "BentArrow" | "UturnArrow" | "CircularArrow" | "LeftCircularArrow" | "LeftRightCircularArrow" | "CurvedRightArrow" | "CurvedLeftArrow" | "CurvedUpArrow" | "CurvedDownArrow" | "SwooshArrow" | "Cube" | "Can" | "LightningBolt" | "Heart" | "Sun" | "Moon" | "SmileyFace" | "IrregularSeal1" | "IrregularSeal2" | "FoldedCorner" | "Bevel" | "Frame" | "HalfFrame" | "Corner" | "DiagonalStripe" | "Chord" | "Arc" | "LeftBracket" | "RightBracket" | "LeftBrace" | "RightBrace" | "BracketPair" | "BracePair" | "Callout1" | "Callout2" | "Callout3" | "AccentCallout1" | "AccentCallout2" | "AccentCallout3" | "BorderCallout1" | "BorderCallout2" | "BorderCallout3" | "AccentBorderCallout1" | "AccentBorderCallout2" | "AccentBorderCallout3" | "WedgeRectCallout" | "WedgeRRectCallout" | "WedgeEllipseCallout" | "CloudCallout" | "Cloud" | "Ribbon" | "Ribbon2" | "EllipseRibbon" | "EllipseRibbon2" | "LeftRightRibbon" | "VerticalScroll" | "HorizontalScroll" | "Wave" | "DoubleWave" | "Plus" | "FlowChartProcess" | "FlowChartDecision" | "FlowChartInputOutput" | "FlowChartPredefinedProcess" | "FlowChartInternalStorage" | "FlowChartDocument" | "FlowChartMultidocument" | "FlowChartTerminator" | "FlowChartPreparation" | "FlowChartManualInput" | "FlowChartManualOperation" | "FlowChartConnector" | "FlowChartPunchedCard" | "FlowChartPunchedTape" | "FlowChartSummingJunction" | "FlowChartOr" | "FlowChartCollate" | "FlowChartSort" | "FlowChartExtract" | "FlowChartMerge" | "FlowChartOfflineStorage" | "FlowChartOnlineStorage" | "FlowChartMagneticTape" | "FlowChartMagneticDisk" | "FlowChartMagneticDrum" | "FlowChartDisplay" | "FlowChartDelay" | "FlowChartAlternateProcess" | "FlowChartOffpageConnector" | "ActionButtonBlank" | "ActionButtonHome" | "ActionButtonHelp" | "ActionButtonInformation" | "ActionButtonForwardNext" | "ActionButtonBackPrevious" | "ActionButtonEnd" | "ActionButtonBeginning" | "ActionButtonReturn" | "ActionButtonDocument" | "ActionButtonSound" | "ActionButtonMovie" | "Gear6" | "Gear9" | "Funnel" | "MathPlus" | "MathMinus" | "MathMultiply" | "MathDivide" | "MathEqual" | "MathNotEqual" | "CornerTabs" | "SquareTabs" | "PlaqueTabs" | "ChartX" | "ChartStar" | "ChartPlus";
Property Value
Word.GeometricShapeType | "LineInverse" | "Triangle" | "RightTriangle" | "Rectangle" | "Diamond" | "Parallelogram" | "Trapezoid" | "NonIsoscelesTrapezoid" | "Pentagon" | "Hexagon" | "Heptagon" | "Octagon" | "Decagon" | "Dodecagon" | "Star4" | "Star5" | "Star6" | "Star7" | "Star8" | "Star10" | "Star12" | "Star16" | "Star24" | "Star32" | "RoundRectangle" | "Round1Rectangle" | "Round2SameRectangle" | "Round2DiagonalRectangle" | "SnipRoundRectangle" | "Snip1Rectangle" | "Snip2SameRectangle" | "Snip2DiagonalRectangle" | "Plaque" | "Ellipse" | "Teardrop" | "HomePlate" | "Chevron" | "PieWedge" | "Pie" | "BlockArc" | "Donut" | "NoSmoking" | "RightArrow" | "LeftArrow" | "UpArrow" | "DownArrow" | "StripedRightArrow" | "NotchedRightArrow" | "BentUpArrow" | "LeftRightArrow" | "UpDownArrow" | "LeftUpArrow" | "LeftRightUpArrow" | "QuadArrow" | "LeftArrowCallout" | "RightArrowCallout" | "UpArrowCallout" | "DownArrowCallout" | "LeftRightArrowCallout" | "UpDownArrowCallout" | "QuadArrowCallout" | "BentArrow" | "UturnArrow" | "CircularArrow" | "LeftCircularArrow" | "LeftRightCircularArrow" | "CurvedRightArrow" | "CurvedLeftArrow" | "CurvedUpArrow" | "CurvedDownArrow" | "SwooshArrow" | "Cube" | "Can" | "LightningBolt" | "Heart" | "Sun" | "Moon" | "SmileyFace" | "IrregularSeal1" | "IrregularSeal2" | "FoldedCorner" | "Bevel" | "Frame" | "HalfFrame" | "Corner" | "DiagonalStripe" | "Chord" | "Arc" | "LeftBracket" | "RightBracket" | "LeftBrace" | "RightBrace" | "BracketPair" | "BracePair" | "Callout1" | "Callout2" | "Callout3" | "AccentCallout1" | "AccentCallout2" | "AccentCallout3" | "BorderCallout1" | "BorderCallout2" | "BorderCallout3" | "AccentBorderCallout1" | "AccentBorderCallout2" | "AccentBorderCallout3" | "WedgeRectCallout" | "WedgeRRectCallout" | "WedgeEllipseCallout" | "CloudCallout" | "Cloud" | "Ribbon" | "Ribbon2" | "EllipseRibbon" | "EllipseRibbon2" | "LeftRightRibbon" | "VerticalScroll" | "HorizontalScroll" | "Wave" | "DoubleWave" | "Plus" | "FlowChartProcess" | "FlowChartDecision" | "FlowChartInputOutput" | "FlowChartPredefinedProcess" | "FlowChartInternalStorage" | "FlowChartDocument" | "FlowChartMultidocument" | "FlowChartTerminator" | "FlowChartPreparation" | "FlowChartManualInput" | "FlowChartManualOperation" | "FlowChartConnector" | "FlowChartPunchedCard" | "FlowChartPunchedTape" | "FlowChartSummingJunction" | "FlowChartOr" | "FlowChartCollate" | "FlowChartSort" | "FlowChartExtract" | "FlowChartMerge" | "FlowChartOfflineStorage" | "FlowChartOnlineStorage" | "FlowChartMagneticTape" | "FlowChartMagneticDisk" | "FlowChartMagneticDrum" | "FlowChartDisplay" | "FlowChartDelay" | "FlowChartAlternateProcess" | "FlowChartOffpageConnector" | "ActionButtonBlank" | "ActionButtonHome" | "ActionButtonHelp" | "ActionButtonInformation" | "ActionButtonForwardNext" | "ActionButtonBackPrevious" | "ActionButtonEnd" | "ActionButtonBeginning" | "ActionButtonReturn" | "ActionButtonDocument" | "ActionButtonSound" | "ActionButtonMovie" | "Gear6" | "Gear9" | "Funnel" | "MathPlus" | "MathMinus" | "MathMultiply" | "MathDivide" | "MathEqual" | "MathNotEqual" | "CornerTabs" | "SquareTabs" | "PlaqueTabs" | "ChartX" | "ChartStar" | "ChartPlus"
Remarks
height
The height, in points, of the shape.
height?: number;
Property Value
number
Remarks
heightRelative
The percentage of shape height to vertical relative size, see Word.RelativeSize. For an inline or child shape, it can't be set.
heightRelative?: number;
Property Value
number
Remarks
id
Gets an integer that represents the shape identifier.
id?: number;
Property Value
number
Remarks
isChild
Check whether this shape is a child of a group shape or a canvas shape.
isChild?: boolean;
Property Value
boolean
Remarks
left
The distance, in points, from the left side of the shape to the horizontal relative position, see Word.RelativeHorizontalPosition. For an inline shape, it will return 0 and can't be set. For a child shape in a canvas or group, it's relative to the top left corner.
left?: number;
Property Value
number
Remarks
leftRelative
The relative left position as a percentage from the left side of the shape to the horizontal relative position, see Word.RelativeHorizontalPosition. For an inline or child shape, it will return 0 and can't be set.
leftRelative?: number;
Property Value
number
Remarks
lockAspectRatio
Specifies if the aspect ratio of this shape is locked.
lockAspectRatio?: boolean;
Property Value
boolean
Remarks
name
parentCanvas
Gets the top-level parent canvas shape of this child shape. It will be null if it isn't a child shape of a canvas.
parentCanvas?: Word.Interfaces.ShapeData;
Property Value
Remarks
parentGroup
Gets the top-level parent group shape of this child shape. It will be null if it isn't a child shape of a group.
parentGroup?: Word.Interfaces.ShapeData;
Property Value
Remarks
relativeHorizontalPosition
The relative horizontal position of the shape. For an inline shape, it can't be set. For details, see Word.RelativeHorizontalPosition.
relativeHorizontalPosition?: Word.RelativeHorizontalPosition | "Margin" | "Page" | "Column" | "Character" | "LeftMargin" | "RightMargin" | "InsideMargin" | "OutsideMargin";
Property Value
Word.RelativeHorizontalPosition | "Margin" | "Page" | "Column" | "Character" | "LeftMargin" | "RightMargin" | "InsideMargin" | "OutsideMargin"
Remarks
relativeHorizontalSize
The relative horizontal size of the shape. For an inline or child shape, it can't be set. For details, see Word.RelativeHorizontalPosition.
relativeHorizontalSize?: Word.RelativeSize | "Margin" | "Page" | "TopMargin" | "BottomMargin" | "InsideMargin" | "OutsideMargin";
Property Value
Word.RelativeSize | "Margin" | "Page" | "TopMargin" | "BottomMargin" | "InsideMargin" | "OutsideMargin"
Remarks
relativeVerticalPosition
The relative vertical position of the shape. For an inline shape, it can't be set. For details, see Word.RelativeVerticalPosition.
relativeVerticalPosition?: Word.RelativeVerticalPosition | "Margin" | "Page" | "Paragraph" | "Line" | "TopMargin" | "BottomMargin" | "InsideMargin" | "OutsideMargin";
Property Value
Word.RelativeVerticalPosition | "Margin" | "Page" | "Paragraph" | "Line" | "TopMargin" | "BottomMargin" | "InsideMargin" | "OutsideMargin"
Remarks
relativeVerticalSize
The relative vertical size of the shape. For an inline or child shape, it can't be set. For details, see Word.RelativeHorizontalPosition.
relativeVerticalSize?: Word.RelativeSize | "Margin" | "Page" | "TopMargin" | "BottomMargin" | "InsideMargin" | "OutsideMargin";
Property Value
Word.RelativeSize | "Margin" | "Page" | "TopMargin" | "BottomMargin" | "InsideMargin" | "OutsideMargin"
Remarks
rotation
Specifies the rotation, in degrees, of the shape. Not applicable to Canvas shape.
rotation?: number;
Property Value
number
Remarks
shapeGroup
Gets the shape group associated with the shape. An object with its isNullObject
property set to true
will be returned if the shape type isn't "GroupShape". For further information, see *OrNullObject methods and properties.
shapeGroup?: Word.Interfaces.ShapeGroupData;
Property Value
Remarks
textFrame
Gets the text frame object of the shape.
textFrame?: Word.Interfaces.TextFrameData;
Property Value
Remarks
textWrap
Returns the text wrap formatting of the shape.
textWrap?: Word.Interfaces.ShapeTextWrapData;
Property Value
Remarks
top
The distance, in points, from the top edge of the shape to the vertical relative position, see Word.RelativeVerticalPosition. For an inline shape, it will return 0 and can't be set. For a child shape in a canvas or group, it's relative to the top left corner.
top?: number;
Property Value
number
Remarks
topRelative
The relative top position as a percentage from the top edge of the shape to the vertical relative position, see Word.RelativeVerticalPosition. For an inline or child shape, it will return 0 and can't be set.
topRelative?: number;
Property Value
number
Remarks
type
Gets the shape type. Currently, only the following shapes are supported: text boxes, geometric shapes, groups, pictures, and canvases.
type?: Word.ShapeType | "Unsupported" | "TextBox" | "GeometricShape" | "Group" | "Picture" | "Canvas";
Property Value
Word.ShapeType | "Unsupported" | "TextBox" | "GeometricShape" | "Group" | "Picture" | "Canvas"
Remarks
visible
Specifies if the shape is visible. Not applicable to inline shapes.
visible?: boolean;
Property Value
boolean
Remarks
width
The width, in points, of the shape.
width?: number;
Property Value
number
Remarks
widthRelative
The percentage of shape width to horizontal relative size, see Word.RelativeSize. For an inline or child shape, it can't be set.
widthRelative?: number;
Property Value
number
Remarks
Office Add-ins