Aspose::Cells::Drawing::OleObject class

OleObject class

Represents an OleObject in a worksheet.

class OleObject : public Aspose::Cells::Drawing::Shape

Methods

MethodDescription
AddHyperlink(const U16String& address)Adds a hyperlink to the shape.
AddHyperlink(const char16_t* address)Adds a hyperlink to the shape.
AlignTopRightCorner(int32_t topRow, int32_t rightColumn)Moves the picture to the top-right corner.
CalculateTextSize()Recalculate the text area.
Characters(int32_t startIndex, int32_t length)Returns a Characters object that represents a range of characters within the text.
FormatCharacters(int32_t startIndex, int32_t length, const Aspose::Cells::Font& font, const StyleFlag& flag)Formats some characters with the font setting.
GetActiveXControl()Gets the ActiveX control.
GetActualBox()Get the actual position and size of the shape (after applying rotation, flip, etc.)
GetActualLowerRightRow()Get the actual bottom row.
GetAlternativeText()Returns or sets the descriptive (alternative) text string of the Shape object.
GetAnchorType()Gets and set the shape anchor placeholder.
GetAutoLoad()Specifies whether the host application for the embedded object shall be called to load the object data automatically when the parent workbook is opened.
GetAutoShapeType()Gets and sets the auto shape type.
GetAutoUpdate()Specifies whether the link to the OleObject is automatically updated or not.
GetBottom()Represents the width of the shape’s vertical offset from its lower bottom corner row, in unit of pixels.
GetClassIdentifier()Gets and sets the class identifier of the embedded object. It means which application opens the embedded file.
GetControlData()Gets the data of control.
GetCreateId(UUID& uuid)Gets and sets create id for this shape.
GetDisplayAsIcon()True if the specified object is displayed as an icon and the image will not be auto changed.
GetFileFormatType()Gets and sets the file type of the embedded ole object data.
GetFill()Returns a FillFormat object that contains fill formatting properties for the specified shape.
GetFont()Represents the font of shape.
GetFormatPicture()Gets and sets the options of the picture format.
GetFullObjectBin()Gets the full embedded ole object binary data in the template file.
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.
GetHasLine()Gets and sets the line border of the shape is visible.
GetHeight()Represents the height of shape, in unit of pixel.
GetHeightCM()Represents the height of the shape, in unit of centimeters.
GetHeightInch()Represents the height of the shape, in unit of inches.
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..
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.
GetHyperlink()Gets the hyperlink of the shape.
GetId()Gets the identifier of this shape.
GetImageData()Represents image of ole object as byte array.
GetImageSourceFullName()Gets or sets the path and name of the source file for the linked image.
GetImageType()Gets the image format of the ole object.
GetInputRange()Gets or sets the worksheet range used to fill the specified combo box.
GetInputRange(bool isR1C1, bool isLocal)Gets the range used to fill the control.
GetLabel()Gets and sets the display label of the linked ole object.
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.
GetLeftInch()Represents the horizontal offset of shape from its left column, in unit of inches.
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.
GetLeftToCorner()Gets and sets the horizonal offset of shape from worksheet left border.
GetLine()Gets line style.
GetLinkedCell()Gets or sets the worksheet range linked to the control’s value.
GetLinkedCell(bool isR1C1, bool isLocal)Gets the range linked to the control’s value.
GetLockedProperty(ShapeLockType type)Gets the value of locked property.
GetLowerDeltaX()Gets or sets the shape’s horizontal offset from its lower right corner column.
GetLowerDeltaY()Gets or sets the shape’s vertical offset from its lower right corner row.
GetLowerRightColumn()Represents lower right corner column index.
GetLowerRightRow()Represents lower right corner row index.
GetMacroName()Gets and sets the name of macro.
GetMsoDrawingType()Gets mso drawing type.
GetName()Gets and sets the name of the shape.
GetObjectData()Represents embedded ole object data as byte array.
GetObjectSourceFullName()Returns the source full name of the source file for the linked OLE object.
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.
GetProgID()Gets or sets the ProgID of the OLE object.
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()Returns all Characters objects that represents a range of characters within the text .
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 Drawing.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 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()Represents the string in this TextBox object.
GetTextBody()Gets and sets the setting of the shape’s text.
GetTextDirection()Gets/Sets the direction of the text flow for this object.
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.
GetTextHorizontalOverflow()Gets and sets the text horizontal overflow type of the shape which contains text.
GetTextOptions()Represents the text options of the shape.
GetTextOrientationType()Gets and sets the text orientation type of the shape.
GetTextShapeType()Gets and sets the preset text shape type.
GetTextVerticalAlignment()Gets and sets the text vertical alignment type of the shape.
GetTextVerticalOverflow()Gets and sets the text vertical overflow type of the shape which contains text.
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.
GetTopCM()Represents the vertical offset of shape from its top row, in unit of centimeters.
GetTopInch()Represents the vertical offset of shape from its top row, in unit of inches.
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.
GetTopToCorner()Gets and sets the vertical offset of shape from worksheet top border, in unit of pixels.
GetType()Gets the auto shape type.
GetUpperDeltaX()Gets or sets the shape’s horizontal offset from its upper left corner column.
GetUpperDeltaY()Gets or sets the shape’s vertical offset from its upper left corner row.
GetUpperLeftColumn()Represents upper left corner column index.
GetUpperLeftRow()Represents upper left corner row index.
GetWidth()Represents the width of shape, in unit of pixels.
GetWidthCM()Represents the width of the shape, in unit of centimeters.
GetWidthInch()Represents the width of the shape, in unit of inch.
GetWidthInShape()Represents the width of the shape, in unit of 1/4000 of the parent shape.
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.
IsAutoSize()True indicates that the size of the ole object will be auto changed as the size of snapshot of the embedded content when the ole object is activated.
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 the shape is a group.
IsHidden()Indicates whether the object is visible.
IsInGroup()Indicates whether the shape is grouped.
IsLink()Returns true if the OleObject links to the file.
IsLockAspectRatio()True means that don’t allow changes in aspect ratio.
IsLocked()True if the object is locked, False if the object can be modified when the sheet is protected.
IsNull() constChecks whether the implementation object is nullptr.
IsPrintable()True if the object is printable.
IsRichText()Whether or not the text is rich text.
IsSmartArt()Indicates whether the shape is smart art.
IsTextWrapped()Gets and sets the text wrapped type of the shape which contains text.
IsWordArt()Indicates whether this shape is a word art.
MoveToRange(int32_t upperLeftRow, int32_t upperLeftColumn, int32_t lowerRightRow, int32_t lowerRightColumn)Moves the shape to a specified range.
OleObject(OleObject_Impl* impl)Constructs from an implementation object.
OleObject(const OleObject& src)Copy constructor.
OleObject(const Shape& src)Constructs from a parent object.
explicit operator bool() constoperator bool()
operator=(const OleObject& src)operator=
operator=(const Shape& src)operator=
RemoveActiveXControl()Remove activeX control.
RemoveHyperlink()Remove the hyperlink of the shape.
Set_IsLink(bool value)Returns true if the OleObject links to the file.
SetAlternativeText(const U16String& value)Returns or sets the descriptive (alternative) text string of the Shape object.
SetAlternativeText(const char16_t* value)Returns or sets the descriptive (alternative) text string of the Shape object.
SetAnchorType(ShapeAnchorType value)Gets and set the shape anchor placeholder.
SetAutoLoad(bool value)Specifies whether the host application for the embedded object shall be called to load the object data automatically when the parent workbook is opened.
SetAutoShapeType(AutoShapeType value)Gets and sets the auto shape type.
SetAutoUpdate(bool value)Specifies whether the link to the OleObject is automatically updated or not.
SetBottom(int32_t value)Represents the width of the shape’s vertical offset from its lower bottom corner row, in unit of pixels.
SetClassIdentifier(const Vector <uint8_t>& value)Gets and sets the class identifier of the embedded object. It means which application opens the embedded file.
SetCreateId(const UUID& value)Gets and sets create id for this shape.
SetDisplayAsIcon(bool value)True if the specified object is displayed as an icon and the image will not be auto changed.
SetEmbeddedObject(bool linkToFile, const Vector <uint8_t>& objectData, const U16String& sourceFileName, bool displayAsIcon, const U16String& label)Sets embedded object data.
SetEmbeddedObject(bool linkToFile, const Vector <uint8_t>& objectData, const char16_t* sourceFileName, bool displayAsIcon, const char16_t* label)Sets embedded object data.
SetEmbeddedObject(bool linkToFile, const Vector <uint8_t>& objectData, const U16String& sourceFileName, bool displayAsIcon, const U16String& label, bool updateIcon)Sets embedded object data.
SetEmbeddedObject(bool linkToFile, const Vector <uint8_t>& objectData, const char16_t* sourceFileName, bool displayAsIcon, const char16_t* label, bool updateIcon)Sets embedded object data.
SetFileFormatType(FileFormatType value)Gets and sets the file type of the embedded ole object data.
SetFont(const Aspose::Cells::Font& value)Represents the font of shape.
SetHasLine(bool value)Gets and sets the line border of the shape is visible.
SetHeight(int32_t value)Represents the height of shape, in unit of pixel.
SetHeightCM(double value)Represents the height of the shape, in unit of centimeters.
SetHeightInch(double value)Represents the height of the shape, in unit of inches.
SetHeightInShape(int32_t value)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..
SetHeightPt(double value)Represents the height of the shape, in unit of points.
SetHeightScale(int32_t value)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;.
SetHtmlText(const U16String& value)Gets and sets the html string which contains data and some formats in this textbox.
SetHtmlText(const char16_t* value)Gets and sets the html string which contains data and some formats in this textbox.
SetImageData(const Vector <uint8_t>& value)Represents image of ole object as byte array.
SetImageSourceFullName(const U16String& value)Gets or sets the path and name of the source file for the linked image.
SetImageSourceFullName(const char16_t* value)Gets or sets the path and name of the source file for the linked image.
SetInputRange(const U16String& value)Gets or sets the worksheet range used to fill the specified combo box.
SetInputRange(const char16_t* value)Gets or sets the worksheet range used to fill the specified combo box.
SetInputRange(const U16String& formula, bool isR1C1, bool isLocal)Sets the range used to fill the control.
SetInputRange(const char16_t* formula, bool isR1C1, bool isLocal)Sets the range used to fill the control.
SetIsAutoSize(bool value)True indicates that the size of the ole object will be auto changed as the size of snapshot of the embedded content when the ole object is activated.
SetIsFilled(bool value)Indicates whether the fill format is visible.
SetIsFlippedHorizontally(bool value)Gets and sets whether shape is horizontally flipped .
SetIsFlippedVertically(bool value)Gets and sets whether shape is vertically flipped .
SetIsHidden(bool value)Indicates whether the object is visible.
SetIsLockAspectRatio(bool value)True means that don’t allow changes in aspect ratio.
SetIsLocked(bool value)True if the object is locked, False if the object can be modified when the sheet is protected.
SetIsPrintable(bool value)True if the object is printable.
SetIsTextWrapped(bool value)Gets and sets the text wrapped type of the shape which contains text.
SetLabel(const U16String& value)Gets and sets the display label of the linked ole object.
SetLabel(const char16_t* value)Gets and sets the display label of the linked ole object.
SetLeft(int32_t value)Represents the horizontal offset of shape from its left column, in unit of pixels.
SetLeftCM(double value)Represents the horizontal offset of shape from its left column, in unit of centimeters.
SetLeftInch(double value)Represents the horizontal offset of shape from its left column, in unit of inches.
SetLeftInShape(int32_t value)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.
SetLeftToCorner(int32_t value)Gets and sets the horizonal offset of shape from worksheet left border.
SetLinkedCell(const U16String& value)Gets or sets the worksheet range linked to the control’s value.
SetLinkedCell(const char16_t* value)Gets or sets the worksheet range linked to the control’s value.
SetLinkedCell(const U16String& formula, bool isR1C1, bool isLocal)Sets the range linked to the control’s value.
SetLinkedCell(const char16_t* formula, bool isR1C1, bool isLocal)Sets the range linked to the control’s value.
SetLockedProperty(ShapeLockType type, bool value)Set the locked property.
SetLowerDeltaX(int32_t value)Gets or sets the shape’s horizontal offset from its lower right corner column.
SetLowerDeltaY(int32_t value)Gets or sets the shape’s vertical offset from its lower right corner row.
SetLowerRightColumn(int32_t value)Represents lower right corner column index.
SetLowerRightRow(int32_t value)Represents lower right corner row index.
SetMacroName(const U16String& value)Gets and sets the name of macro.
SetMacroName(const char16_t* value)Gets and sets the name of macro.
SetName(const U16String& value)Gets and sets the name of the shape.
SetName(const char16_t* value)Gets and sets the name of the shape.
SetNativeSourceFullName(const U16String& sourceFullName)Sets the ole native source full file name with path.
SetNativeSourceFullName(const char16_t* sourceFullName)Sets the ole native source full file name with path.
SetObjectData(const Vector <uint8_t>& value)Represents embedded ole object data as byte array.
SetObjectSourceFullName(const U16String& value)Returns the source full name of the source file for the linked OLE object.
SetObjectSourceFullName(const char16_t* value)Returns the source full name of the source file for the linked OLE object.
SetPlacement(PlacementType value)Represents the way the drawing object is attached to the cells below it. The property controls the placement of an object on a worksheet.
SetProgID(const U16String& value)Gets or sets the ProgID of the OLE object.
SetProgID(const char16_t* value)Gets or sets the ProgID of the OLE object.
SetRelativeToOriginalPictureSize(bool value)Indicates whether shape is relative to original picture size.
SetRight(int32_t value)Represents the width of the shape’s horizontal offset from its lower right corner column, in unit of pixels.
SetRotationAngle(double value)Gets and sets the rotation of the shape.
SetSoftEdges(double value)Gets and sets the radius of blur to apply to the edges, in unit of points.
SetText(const U16String& value)Represents the string in this TextBox object.
SetText(const char16_t* value)Represents the string in this TextBox object.
SetTextDirection(TextDirectionType value)Gets/Sets the direction of the text flow for this object.
SetTextHorizontalAlignment(TextAlignmentType value)Gets and sets the text horizontal alignment type of the shape.
SetTextHorizontalOverflow(TextOverflowType value)Gets and sets the text horizontal overflow type of the shape which contains text.
SetTextOptions(const TextOptions& value)Represents the text options of the shape.
SetTextOrientationType(TextOrientationType value)Gets and sets the text orientation type of the shape.
SetTextShapeType(AutoShapeType value)Gets and sets the preset text shape type.
SetTextVerticalAlignment(TextAlignmentType value)Gets and sets the text vertical alignment type of the shape.
SetTextVerticalOverflow(TextOverflowType value)Gets and sets the text vertical overflow type of the shape which contains text.
SetTitle(const U16String& value)Specifies the title (caption) of the current shape object.
SetTitle(const char16_t* value)Specifies the title (caption) of the current shape object.
SetTop(int32_t value)Represents the vertical offset of shape from its top row, in unit of pixels.
SetTopCM(double value)Represents the vertical offset of shape from its top row, in unit of centimeters.
SetTopInch(double value)Represents the vertical offset of shape from its top row, in unit of inches.
SetTopInShape(int32_t value)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.
SetTopToCorner(int32_t value)Gets and sets the vertical offset of shape from worksheet top border, in unit of pixels.
SetUpperDeltaX(int32_t value)Gets or sets the shape’s horizontal offset from its upper left corner column.
SetUpperDeltaY(int32_t value)Gets or sets the shape’s vertical offset from its upper left corner row.
SetUpperLeftColumn(int32_t value)Represents upper left corner column index.
SetUpperLeftRow(int32_t value)Represents upper left corner row index.
SetWidth(int32_t value)Represents the width of shape, in unit of pixels.
SetWidthCM(double value)Represents the width of the shape, in unit of centimeters.
SetWidthInch(double value)Represents the width of the shape, in unit of inch.
SetWidthInShape(int32_t value)Represents the width of the shape, in unit of 1/4000 of the parent shape.
SetWidthPt(double value)Represents the width of the shape, in unit of point.
SetWidthScale(int32_t value)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(int32_t value)Gets and sets the horizontal offset of shape from worksheet left border,in unit of pixels.
SetY(int32_t value)Gets and sets the vertical offset of shape from worksheet top border,in unit of pixels.
SetZOrderPosition(int32_t value)Returns the position of a shape in the z-order.
Shape(Shape_Impl* impl)Constructs from an implementation object.
Shape(const Shape& src)Copy constructor.
ToFrontOrBack(int32_t orders)Brings the shape to the front or sends the shape to back.
ToImage(const Vector <uint8_t>& stream, Aspose::Cells::Drawing::ImageType imageType)Creates the shape image and saves it to a stream in the specified format.
ToImage(const U16String& imageFile, const ImageOrPrintOptions& options)Saves the shape to a file.
ToImage(const char16_t* imageFile, const ImageOrPrintOptions& options)Saves the shape to a file.
ToImage(const ImageOrPrintOptions& options)Saves the shape to a stream.
UpdateSelectedValue()Update the selected value by the value of the linked cell.
~OleObject()Destructor.
~Shape()Destructor.

Fields

FieldDescription
_implThe implementation object.

Examples

Aspose::Cells::Startup();
//Instantiate a new Workbook.
Workbook workbook;
//Get the first worksheet.
Worksheet sheet = workbook.GetWorksheets().Get(0);

//Get the picture data into "iconData". e.g: An .jpg file named "school.jpg"
//(Note: You need to read the data into this variable.)
Vector<uint8_t> iconData{0};

//Get the ole object data into "objectData". e.g: An .xls file named "Book1.xls"
//(Note: You need to read the data into this variable.)
Vector<uint8_t> objectData{0};

//Add an Ole object into the worksheet with the image
//shown in MS Excel.
sheet.GetOleObjects().Add(14, 3, 200, 220, iconData);
//Set embedded ole object data.
sheet.GetOleObjects().Get(0).SetObjectData(objectData);
//Save the excel file
workbook.Save(u"oleobjects.xls");


Aspose::Cells::Cleanup();

See Also