SetEmbeddedData()

IOleObjectFrame::SetEmbeddedData(System::SharedPtr<IOleEmbeddedDataInfo>) method

Sets information about OLE embedded data.

virtual void Aspose::Slides::IOleObjectFrame::SetEmbeddedData(System::SharedPtr<IOleEmbeddedDataInfo> embeddedData)=0

Arguments

ParameterTypeDescription
embeddedDataSystem::SharedPtr<IOleEmbeddedDataInfo>Embedded data IOleEmbeddedDataInfo

Remarks

This method changes the properties of the object to reflect the new data and sets the IsObjectLink flag to false, indicating that the OLE object is embedded.

Following example demonstrates how to change OLE embedded data and its type for existing IOleObjectFrame object

System::SharedPtr<Presentation> pres = System::MakeObject<Presentation>(u"SomePresentation.pptx");

System::SharedPtr<OleObjectFrame> oof = System::AsCast<Aspose::Slides::OleObjectFrame>(pres->get_Slides()->idx_get(0)->get_Shapes()->idx_get(0));
if (oof != nullptr)
{
    System::SharedPtr<IOleEmbeddedDataInfo> newData = System::MakeObject<OleEmbeddedDataInfo>(System::IO::File::ReadAllBytes(u"Picture.png"), u"png");
    oof->SetEmbeddedData(newData);
}

See Also