InsertOleObjectFrame()

ShapeCollection::InsertOleObjectFrame(int32_t, float, float, float, float, System::SharedPtr<IOleEmbeddedDataInfo>) method

Creates a new OLE object frame and inserts it into the shape collection at the specified index.

System::SharedPtr<IOleObjectFrame> Aspose::Slides::ShapeCollection::InsertOleObjectFrame(int32_t index, float x, float y, float width, float height, System::SharedPtr<IOleEmbeddedDataInfo> dataInfo) override

Arguments

ParameterTypeDescription
indexint32_tThe zero-based index at which to insert the OLE object frame.
xfloatThe x-coordinate of the new OLE frame, in points.
yfloatThe y-coordinate of the new OLE frame, in points.
widthfloatThe width of the new OLE frame, in points.
heightfloatThe height of the new OLE frame, in points.
dataInfoSystem::SharedPtr<IOleEmbeddedDataInfo>The embedded OLE data information (IOleEmbeddedDataInfo).

Return Value

The newly created IOleObjectFrame.

Remarks

This example demonstrates inserting an OLE object at the second index:

ArrayPtr<uint8_t> fileData = IO::File::ReadAllBytes(u"test.zip");
auto dataInfo = MakeObject<OleEmbeddedDataInfo>(fileData, u"zip");
auto oleObjectFrame = slide->get_Shapes()->InsertOleObjectFrame(2, 150.0f, 20.0f, 50.0f, 50.0f, dataInfo);

ShapeCollection::InsertOleObjectFrame(int32_t, float, float, float, float, System::String, System::String) method

Creates a new OLE object frame and inserts it into the shape collection at the specified index.

System::SharedPtr<IOleObjectFrame> Aspose::Slides::ShapeCollection::InsertOleObjectFrame(int32_t index, float x, float y, float width, float height, System::String className, System::String path) override

Arguments

ParameterTypeDescription
indexint32_tThe zero-based index at which to insert the OLE object frame.
xfloatThe x-coordinate of the new OLE frame, in points.
yfloatThe y-coordinate of the new OLE frame, in points.
widthfloatThe width of the new OLE frame, in points.
heightfloatThe height of the new OLE frame, in points.
classNameSystem::StringThe class name of the OLE object.
pathSystem::StringThe path to the linked file.

Return Value

The newly created OLE object frame.

Remarks

This path is stored verbatim in the presentation. If a relative path is specified, the file will be inaccessible when opening the presentation from a different directory.

See Also