SetEmbeddedData

OleObjectFrame.SetEmbeddedData method

Sets information about OLE embedded data. 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.

public void SetEmbeddedData(IOleEmbeddedDataInfo embeddedData)
ParameterTypeDescription
embeddedDataIOleEmbeddedDataInfoEmbedded data IOleEmbeddedDataInfo

Exceptions

exceptioncondition
ArgumentNullExceptionWhen embeddedData parameter is null.

Examples

[C#]
using (Presentation pres = new Presentation("SomePresentation.pptx"))
{
    OleObjectFrame oof = pres.Slides[0].Shapes[0] as OleObjectFrame;
    if (oof != null)
    {
        IOleEmbeddedDataInfo newData = new OleEmbeddedDataInfo(File.ReadAllBytes("Picture.png"), "png");
        oof.SetEmbeddedData(newData);
    }
}

See Also