Methods

Methods

Adds a hyperlink to the shape.

Parameter

Name Type Optional Description

address

String

 

Address of the hyperlink.

Returns

Hyperlink Return the new hyperlink object.

alignTopRightCorner(topRow, rightColumn)

Moves the picture to the top-right corner.

Parameters

Name Type Optional Description

topRow

Number

 

the row index.

rightColumn

Number

 

the column index.

calculateTextSize() → Array of Number

Recalculate the text area

Returns

Array of Number Text's Size in an array(width and height).

characters(startIndex, length) → FontSetting

Returns a Characters object that represents a range of characters within the text. This method only works on shape with title.

Parameters

Name Type Optional Description

startIndex

Number

 

The index of the start of the character.

length

Number

 

The number of characters.

Returns

FontSetting Characters object.

formatCharacters(startIndex, length, font, flag)

Formats some characters with the font setting.

Parameters

Name Type Optional Description

startIndex

Number

 

The start index.

length

Number

 

The length.

font

Font

 

The font setting.

flag

StyleFlag

 

The flag of the font setting.

getActualBox()

Get the actual position and size of the shape (after applying rotation, flip, etc.) Note:The interface is not fully functional, especially the location information is not correct.It is recommended not to use this interface until the function is complete.@return {float[]} Return the position and size in the order of x, y, w, h

getActualLowerRightRow()

Get the actual bottom row.

getAlternativeText()

Returns or sets the descriptive (alternative) text string of the Shape object.

getAnchorType()

Gets and set the type of the shape anchor placeholder. The value of the property is ShapeAnchorType integer constant.

getAutoShapeType()

Gets and sets the auto shape type. The value of the property is AutoShapeType integer constant.

getBottom()

Represents the width of the shape's vertical offset from its lower bottom corner row, in unit of pixels.

getCharacters() → ArrayList

Returns all Characters objects that represents a range of characters within the text . NOTE: This method is now obsolete. Instead, please use Shape.GetRichFormattings() method. This method will be removed 12 months later since November 2023. Aspose apologizes for any inconvenience you may have experienced.

Returns

ArrayList All Characters objects

getConnectionPoints() → Array of Array of float

Get the connection points

Returns

Array of Array of float [X,Y] pairs of the connection point. Every item is a float[2] array, [0] represents x and [1] represents y.

getControlData()

Gets the data of control.

getCreateId()

Gets and sets create id for this shape.

getFill()

Returns a FillFormat object that contains fill formatting properties for the specified shape.

getFillFormat()

Returns a MsoFillFormat object that contains fill formatting properties for the specified shape. NOTE: This member is now obsolete. Instead, please use Shape.Fill property. This property will be removed 12 months later since July 2016. Aspose apologizes for any inconvenience you may have experienced.

getFont()

Represents the font of shape.

getFormatPicture()

Gets and sets the options of the picture format.

getGeometry()

Gets the geometry

getGlow()

Represents a GlowEffect object that specifies glow effect for the chart element or shape.

getGroup()

Gets the group shape which contains this shape.

getHeight()

Represents the height of shape, in unit of pixel.

getHeightCM()

Represents the height of the shape, in unit of centimeters.

getHeightInShape()

Represents the vertical offset of shape from the top border of the parent shape, in unit of 1/4000 of height of the parent shape.. Only Applies when this shape in the group or chart.

getHeightInch()

Represents the height of the shape, in unit of inches.

getHeightPt()

Represents the height of the shape, in unit of points.

getHeightScale()

Gets and sets the height scale,in unit of percent of the original picture height. If the shape is not picture ,the HeightScale property only returns 100;

getHtmlText()

Gets and sets the html string which contains data and some formats in this textbox.

Gets the hyperlink of the shape.

getId()

Gets the identifier of this shape.

getInputRange()

Gets or sets the worksheet range used to fill the specified combo box.

getInputRange(isR1C1, isLocal) → String

Gets the range used to fill the control.

Parameters

Name Type Optional Description

isR1C1

boolean

 

Whether the formula needs to be formatted as R1C1.

isLocal

boolean

 

Whether the formula needs to be formatted by locale.

Returns

String The range used to fill the control.

getLeft()

Represents the horizontal offset of shape from its left column, in unit of pixels.

getLeftCM()

Represents the horizontal offset of shape from its left column, in unit of centimeters.

getLeftInShape()

Represents the horizontal offset of shape from the left border of the parent shape, in unit of 1/4000 of width of the parent shape. Only Applies when this shape in the group or chart.

getLeftInch()

Represents the horizontal offset of shape from its left column, in unit of inches.

getLeftToCorner()

Gets and sets the horizonal offset of shape from worksheet left border.

getLine()

Gets line style

getLineFormat()

Returns a MsoLineFormat object that contains line formatting properties for the specified shape. NOTE: This member is now obsolete. Instead, please use Shape.Line property. This property will be removed 12 months later since July 2016. Aspose apologizes for any inconvenience you may have experienced.

getLinkedCell()

Gets or sets the worksheet range linked to the control's value.

getLinkedCell(isR1C1, isLocal) → String

Gets the range linked to the control's value.

Parameters

Name Type Optional Description

isR1C1

boolean

 

Whether the formula needs to be formatted as R1C1.

isLocal

boolean

 

Whether the formula needs to be formatted by locale.

Returns

String The range linked to the control's value.

getLockedProperty(type) → boolean

Gets the value of locked property.

Parameter

Name Type Optional Description

type

Number

 

ShapeLockType

Returns

boolean Returns the value of locked property.

getLowerDeltaX()

Gets or sets the shape's horizontal offset from its lower right corner column. The range of value is 0 to 1024.

getLowerDeltaY()

Gets or sets the shape's vertical offset from its lower right corner row. The range of value is 0 to 256.

getLowerRightColumn()

Represents lower right corner column index.

getLowerRightRow()

Represents lower right corner row index.

getMacroName()

Gets and sets the name of macro.

getMsoDrawingType()

Gets drawing type. The value of the property is MsoDrawingType integer constant.

getName()

Gets and sets the name of the shape.

getPaths()

Gets the paths of a custom geometric shape.

getPlacement()

Represents the way the drawing object is attached to the cells below it. The property controls the placement of an object on a worksheet. The value of the property is PlacementType integer constant.

getReflection()

Represents a ReflectionEffect object that specifies reflection effect for the chart element or shape.

getRelativeToOriginalPictureSize()

Indicates whether shape is relative to original picture size.

getResultOfSmartArt()

Converting smart art to grouped shapes.

getRichFormattings() → Array of FontSetting

Returns all Characters objects that represents a range of characters within the text .

Returns

Array of FontSetting All Characters objects

getRight()

Represents the width of the shape's horizontal offset from its lower right corner column, in unit of pixels.

getRotationAngle()

Gets and sets the rotation of the shape.

getShadowEffect()

Represents a ShadowEffect object that specifies shadow effect for the chart element or shape.

getSoftEdges()

Gets and sets the radius of blur to apply to the edges, in unit of points.

getSpid()

Specifies an optional string identifier that an application can use to identify the particular shape.

getSpt()

Specifies an optional number that an application can use to associate the particular shape with a defined shape type.

getText()

Gets and sets the text of this shape.

getTextBody()

Gets and sets the setting of the shape's text.

getTextDirection()

Gets/Sets the direction of the text flow for this object. The value of the property is TextDirectionType integer constant.

getTextEffect()

Returns a TextEffectFormat object that contains text-effect formatting properties for the specified shape. Applies to Shape objects that represent WordArt.

getTextHorizontalAlignment()

Gets and sets the text horizontal alignment type of the shape. The value of the property is TextAlignmentType integer constant.

getTextHorizontalOverflow()

Gets and sets the text horizontal overflow type of the shape which contains text. The value of the property is TextOverflowType integer constant.

getTextOptions()

Represents the text options of the shape.

getTextOrientationType()

Gets and sets the text orientation type of the shape. The value of the property is TextOrientationType integer constant.

getTextShapeType()

Gets and sets the preset text shape type. The value of the property is AutoShapeType integer constant.

getTextVerticalAlignment()

Gets and sets the text vertical alignment type of the shape. The value of the property is TextAlignmentType integer constant.

getTextVerticalOverflow()

Gets and sets the text vertical overflow type of the shape which contains text. The value of the property is TextOverflowType integer constant.

getThreeDFormat()

Gets and sets 3d format of the shape.

getTitle()

Specifies the title (caption) of the current shape object.

getTop()

Represents the vertical offset of shape from its top row, in unit of pixels. If the shape is in the chart, represents the vertical offset of shape from its top border.

getTopCM()

Represents the vertical offset of shape from its top row, in unit of centimeters.

getTopInShape()

Represents the vertical offset of shape from the top border of the parent shape, in unit of 1/4000 of height of the parent shape. Only Applies when this shape in the group or chart.

getTopInch()

Represents the vertical offset of shape from its top row, in unit of inches.

getTopToCorner()

Gets and sets the vertical offset of shape from worksheet top border, in unit of pixels.

getType()

Gets the auto shape type. The value of the property is AutoShapeType integer constant.

getUpperDeltaX()

Gets or sets the shape's horizontal offset from its upper left corner column. The range of value is 0 to 1024.

getUpperDeltaY()

Gets or sets the shape's vertical offset from its upper left corner row. The range of value is 0 to 256.

getUpperLeftColumn()

Represents upper left corner column index.

getUpperLeftRow()

Represents the top row index. If the shape is in the shape or in the group , UpperLeftRow will be ignored.

getWidth()

Represents the width of shape, in unit of pixels.

getWidthCM()

Represents the width of the shape, in unit of centimeters.

getWidthInShape()

Represents the width of the shape, in unit of 1/4000 of the parent shape. Only Applies when this shape in the group or chart.

getWidthInch()

Represents the width of the shape, in unit of inch.

getWidthPt()

Represents the width of the shape, in unit of point.

getWidthScale()

Gets and sets the width scale, in unit of percent of the original picture width. If the shape is not picture ,the WidthScale property only returns 100;

getWorksheet()

Gets the Worksheet object which contains this shape.

getX()

Gets and sets the horizontal offset of shape from worksheet left border,in unit of pixels.

getY()

Gets and sets the vertical offset of shape from worksheet top border,in unit of pixels.

getZOrderPosition()

Returns the position of a shape in the z-order.

hasLine()

Gets and sets the line border of the shape is visible.

isAspectRatioLocked()

True means that aspect ratio of the shape is locked. Only for pictures and Ole Objects.

isEquation()

Indicates whether the shape only contains an equation.

isFilled()

Indicates whether the fill format is visible.

isFlippedHorizontally()

Gets and sets whether shape is horizontally flipped .

isFlippedVertically()

Gets and sets whether shape is vertically flipped .

isGroup()

Indicates whether this shape is a group shape.

isHidden()

Indicates whether the object is visible.

isInGroup()

Indicates whether the shape is grouped.

isLockAspectRatio()

True means that aspect ratio of the shape is locked. Only for pictures and Ole Objects. NOTE: This member is now obsolete. Instead, please use Shape.IsAspectRatioLocked property. This property will be removed 12 months later since July 2024. Aspose apologizes for any inconvenience you may have experienced.

isLocked()

True means the object can not be modified when the sheet is protected. Note that this value is meaningful only if the worksheet or objects in the worksheet are protected.

isPrintable()

Indicates whether the object is printable. If False, this shape will not be printed when printing.

isRichText()

Whether or not the text is rich text.

isSameSetting(obj) → boolean

Returns whether the shape is same.

Parameter

Name Type Optional Description

obj

Object

 

Returns

boolean 

isSmartArt()

Indicates whether the shape is a smart art. Only for ooxml file.

isTextWrapped()

Gets and sets the text wrapped type of the shape which contains text.

isWordArt()

Indicates whether this shape is a word art. Only for the Legacy Shape of xls file.

moveToRange(upperLeftRow, upperLeftColumn, lowerRightRow, lowerRightColumn)

Moves the shape to a specified range.

Parameters

Name Type Optional Description

upperLeftRow

Number

 

Upper left row index.

upperLeftColumn

Number

 

Upper left column index.

lowerRightRow

Number

 

Lower right row index

lowerRightColumn

Number

 

Lower right column index

removeActiveXControl()

Remove activeX control.

Removes the hyperlink of the shape.

setAlternativeText()

Returns or sets the descriptive (alternative) text string of the Shape object.

setAnchorType()

Gets and set the type of the shape anchor placeholder. The value of the property is ShapeAnchorType integer constant.

setAspectRatioLocked()

True means that aspect ratio of the shape is locked. Only for pictures and Ole Objects.

setAutoShapeType()

Gets and sets the auto shape type. The value of the property is AutoShapeType integer constant.

setBottom()

Represents the width of the shape's vertical offset from its lower bottom corner row, in unit of pixels.

setCreateId()

Gets and sets create id for this shape.

setFilled()

Indicates whether the fill format is visible.

setFlippedHorizontally()

Gets and sets whether shape is horizontally flipped .

setFlippedVertically()

Gets and sets whether shape is vertically flipped .

setFont()

Represents the font of shape.

setHasLine()

Gets and sets the line border of the shape is visible.

setHeight()

Represents the height of shape, in unit of pixel.

setHeightCM()

Represents the height of the shape, in unit of centimeters.

setHeightInShape()

Represents the vertical offset of shape from the top border of the parent shape, in unit of 1/4000 of height of the parent shape.. Only Applies when this shape in the group or chart.

setHeightInch()

Represents the height of the shape, in unit of inches.

setHeightPt()

Represents the height of the shape, in unit of points.

setHeightScale()

Gets and sets the height scale,in unit of percent of the original picture height. If the shape is not picture ,the HeightScale property only returns 100;

setHidden()

Indicates whether the object is visible.

setHtmlText()

Gets and sets the html string which contains data and some formats in this textbox.

setInputRange()

Gets or sets the worksheet range used to fill the specified combo box.

setInputRange(formula, isR1C1, isLocal)

Sets the range used to fill the control.

Parameters

Name Type Optional Description

formula

String

 

The range used to fill the control.

isR1C1

boolean

 

Whether the formula needs to be formatted as R1C1.

isLocal

boolean

 

Whether the formula needs to be formatted by locale.

setLeft()

Represents the horizontal offset of shape from its left column, in unit of pixels.

setLeftCM()

Represents the horizontal offset of shape from its left column, in unit of centimeters.

setLeftInShape()

Represents the horizontal offset of shape from the left border of the parent shape, in unit of 1/4000 of width of the parent shape. Only Applies when this shape in the group or chart.

setLeftInch()

Represents the horizontal offset of shape from its left column, in unit of inches.

setLeftToCorner()

Gets and sets the horizonal offset of shape from worksheet left border.

setLinkedCell()

Gets or sets the worksheet range linked to the control's value.

setLinkedCell(formula, isR1C1, isLocal)

Sets the range linked to the control's value.

Parameters

Name Type Optional Description

formula

String

 

The range linked to the control's value.

isR1C1

boolean

 

Whether the formula needs to be formatted as R1C1.

isLocal

boolean

 

Whether the formula needs to be formatted by locale.

setLockAspectRatio()

True means that aspect ratio of the shape is locked. Only for pictures and Ole Objects. NOTE: This member is now obsolete. Instead, please use Shape.IsAspectRatioLocked property. This property will be removed 12 months later since July 2024. Aspose apologizes for any inconvenience you may have experienced.

setLocked()

True means the object can not be modified when the sheet is protected. Note that this value is meaningful only if the worksheet or objects in the worksheet are protected.

setLockedProperty(type, value)

Set the locked property.

Parameters

Name Type Optional Description

type

Number

 

ShapeLockType

value

boolean

 

The value of the property.

setLowerDeltaX()

Gets or sets the shape's horizontal offset from its lower right corner column. The range of value is 0 to 1024.

setLowerDeltaY()

Gets or sets the shape's vertical offset from its lower right corner row. The range of value is 0 to 256.

setLowerRightColumn()

Represents lower right corner column index.

setLowerRightRow()

Represents lower right corner row index.

setMacroName()

Gets and sets the name of macro.

setName()

Gets and sets the name of the shape.

setPlacement()

Represents the way the drawing object is attached to the cells below it. The property controls the placement of an object on a worksheet. The value of the property is PlacementType integer constant.

setPrintable()

Indicates whether the object is printable. If False, this shape will not be printed when printing.

setRelativeToOriginalPictureSize()

Indicates whether shape is relative to original picture size.

setRight()

Represents the width of the shape's horizontal offset from its lower right corner column, in unit of pixels.

setRotationAngle()

Gets and sets the rotation of the shape.

setSoftEdges()

Gets and sets the radius of blur to apply to the edges, in unit of points.

setText()

Gets and sets the text of this shape.

setTextDirection()

Gets/Sets the direction of the text flow for this object. The value of the property is TextDirectionType integer constant.

setTextHorizontalAlignment()

Gets and sets the text horizontal alignment type of the shape. The value of the property is TextAlignmentType integer constant.

setTextHorizontalOverflow()

Gets and sets the text horizontal overflow type of the shape which contains text. The value of the property is TextOverflowType integer constant.

setTextOptions()

Represents the text options of the shape.

setTextOrientationType()

Gets and sets the text orientation type of the shape. The value of the property is TextOrientationType integer constant.

setTextShapeType()

Gets and sets the preset text shape type. The value of the property is AutoShapeType integer constant.

setTextVerticalAlignment()

Gets and sets the text vertical alignment type of the shape. The value of the property is TextAlignmentType integer constant.

setTextVerticalOverflow()

Gets and sets the text vertical overflow type of the shape which contains text. The value of the property is TextOverflowType integer constant.

setTextWrapped()

Gets and sets the text wrapped type of the shape which contains text.

setTitle()

Specifies the title (caption) of the current shape object.

setTop()

Represents the vertical offset of shape from its top row, in unit of pixels. If the shape is in the chart, represents the vertical offset of shape from its top border.

setTopCM()

Represents the vertical offset of shape from its top row, in unit of centimeters.

setTopInShape()

Represents the vertical offset of shape from the top border of the parent shape, in unit of 1/4000 of height of the parent shape. Only Applies when this shape in the group or chart.

setTopInch()

Represents the vertical offset of shape from its top row, in unit of inches.

setTopToCorner()

Gets and sets the vertical offset of shape from worksheet top border, in unit of pixels.

setUpperDeltaX()

Gets or sets the shape's horizontal offset from its upper left corner column. The range of value is 0 to 1024.

setUpperDeltaY()

Gets or sets the shape's vertical offset from its upper left corner row. The range of value is 0 to 256.

setUpperLeftColumn()

Represents upper left corner column index.

setUpperLeftRow()

Represents the top row index. If the shape is in the shape or in the group , UpperLeftRow will be ignored.

setWidth()

Represents the width of shape, in unit of pixels.

setWidthCM()

Represents the width of the shape, in unit of centimeters.

setWidthInShape()

Represents the width of the shape, in unit of 1/4000 of the parent shape. Only Applies when this shape in the group or chart.

setWidthInch()

Represents the width of the shape, in unit of inch.

setWidthPt()

Represents the width of the shape, in unit of point.

setWidthScale()

Gets and sets the width scale, in unit of percent of the original picture width. If the shape is not picture ,the WidthScale property only returns 100;

setX()

Gets and sets the horizontal offset of shape from worksheet left border,in unit of pixels.

setY()

Gets and sets the vertical offset of shape from worksheet top border,in unit of pixels.

setZOrderPosition()

Returns the position of a shape in the z-order.

toFrontOrBack(orders)

Brings the shape to the front or sends the shape to back.

Parameter

Name Type Optional Description

orders

Number

 

If it's less than zero, sets the shape to back. If it's greater than zero, brings the shape to front.

toImage()

Saves the shape to a file.

updateSelectedValue()

Update the selected value by the value of the linked cell.