WPF

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Interface IOleObject - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Interface IOleObject

    Represents the OLE object in the PowerPoint presentation.

    Inherited Members
    IShape.SetHyperlink(String)
    IShape.RemoveHyperlink()
    IShape.AutoShapeType
    IShape.ConnectionSiteCount
    IShape.Fill
    IShape.TextBody
    IShape.Hyperlink
    IShape.PlaceholderFormat
    IShape.Rotation
    ISlideItem.Clone()
    ISlideItem.Description
    ISlideItem.SlideItemType
    ISlideItem.Height
    ISlideItem.Hidden
    ISlideItem.Left
    ISlideItem.LineFormat
    ISlideItem.ShapeName
    ISlideItem.Title
    ISlideItem.Top
    ISlideItem.Width
    Namespace: Syncfusion.Presentation
    Assembly: Syncfusion.Presentation.Base.dll
    Syntax
    public interface IOleObject : IShape, ISlideItem

    Properties

    FileName

    Gets the file name of embedded or linked OLE object.

    Declaration
    string FileName { get; }
    Property Value
    Type Description
    System.String

    The string that specifies the file name of the OLE object.

    Examples
    //Load a PowerPoint presentation
    IPresentation presentation = Presentation.Open("Sample.pptx");
    //Get the first slide from the presentation
    ISlide slide = presentation.Slides[0];
    //Get the oleObject from the slide
    IOleObject oleObject = (IShape)slide.Shapes[0] as IOleObject;
    //Gets the embedded OLE object data
    byte[] array = oleObject.ObjectData;
    //Gets the file name of OLE object
    string fileName = oleObject.FileName;
    //Save the extracted OLE data into file system.
    MemoryStream memoryStream = new MemoryStream(array);
    FileStream fileStream = File.Create(fileName);
    memoryStream.CopyTo(fileStream);
    memoryStream.Dispose();
    fileStream.Dispose();
    //Close the Presentation
    presentation.Close();
    'Load a PowerPoint presentation
     Dim presentation As IPresentation = Syncfusion.Presentation.Presentation.Open("Sample.pptx")
     'Get the first slide from the presentation
     Dim slide As ISlide = presentation.Slides(0)
     'Get the oleObject from the slide
     Dim oleObject As IOleObject = CType(CType(slide.Shapes(0), IOleObject), IShape)
     'Gets the embedded OLE object data
     Dim array() As Byte = oleObject.ObjectData
     'Gets the file name of OLE object
     Dim fileName As string = oleObject.FileName
     'Save the extracted OLE data into file system.
     Dim memoryStream As MemoryStream = New MemoryStream(array)
     Dim fileStream As FileStream = File.Create(fileName)
     memoryStream.CopyTo(fileStream)
     memoryStream.Dispose
     fileStream.Dispose
     'Close the Presentation
     presentation.Close()

    ImageData

    Gets the image data for the specified OLE object.

    Declaration
    byte[] ImageData { get; }
    Property Value
    Type Description
    System.Byte[]

    The byte array that specifies the OLE image data.

    Examples
    //Load a PowerPoint presentation
    IPresentation presentation = Presentation.Open("Sample.pptx");
    //Get the first slide from the presentation
    ISlide slide = presentation.Slides[0];
    //Get the oleObject from the slide
    IOleObject oleObject = (IShape)slide.Shapes[0] as IOleObject;
    //Gets the image data of embedded Ole Object.
    byte[] array = oleObject.ImageData;
    //Save the extracted OLE image data into file system.
    MemoryStream memoryStream = new MemoryStream(array);
    FileStream fileStream = File.Create("OleImage.png");
    memoryStream.CopyTo(fileStream);
    memoryStream.Dispose();
    fileStream.Dispose();
    //Close the Presentation
    presentation.Close();
    'Load a PowerPoint presentation
     Dim presentation As IPresentation = Syncfusion.Presentation.Presentation.Open("Sample.pptx")
     'Get the first slide from the presentation
     Dim slide As ISlide = presentation.Slides(0)
     'Get the oleObject from the slide
     Dim oleObject As IOleObject = CType(CType(slide.Shapes(0), IOleObject), IShape)
     'Gets the image data of embedded Ole Object.
     Dim array() As Byte = oleObject.ImageData
     'Save the extracted OLE image data into file system.
     Dim memoryStream As MemoryStream = New MemoryStream(array)
     Dim fileStream As FileStream = File.Create("OleImage.png")
     memoryStream.CopyTo(fileStream)
     memoryStream.Dispose
     fileStream.Dispose
     'Close the Presentation
     presentation.Close()

    LinkPath

    Gets the linked path for the specified OLE object.

    Declaration
    string LinkPath { get; }
    Property Value
    Type Description
    System.String

    The string that specifies the OLE object link address.

    Examples
    //Load a PowerPoint presentation
    IPresentation presentation = Presentation.Open("Sample.pptx");
    //Get the first slide from the presentation
    ISlide slide = presentation.Slides[0];
    //Get the oleObject from the slide
    IOleObject oleObject = (IShape)slide.Shapes[0] as IOleObject;
    //Gets the OLE object linked path
    string objectPath = oleObject.LinkPath;
    //Close the Presentation
    presentation.Close();
    'Load a PowerPoint presentation
     Dim presentation As IPresentation = Syncfusion.Presentation.Presentation.Open("Sample.pptx")
     'Get the first slide from the presentation
     Dim slide As ISlide = presentation.Slides(0)
     'Get the oleObject from the slide
     Dim oleObject As IOleObject = CType(CType(slide.Shapes(0), IOleObject), IShape)
     'Gets the OLE object linked path
     Dim objectPath As String = oleObject.LinkPath
     'Close the Presentation
     presentation.Close()

    ObjectData

    Gets the embedded file data for the specified OLE object.

    Declaration
    byte[] ObjectData { get; }
    Property Value
    Type Description
    System.Byte[]

    The byte array that specifies the embedded file data.

    Examples
    //Load a PowerPoint presentation
    IPresentation presentation = Presentation.Open("Sample.pptx");
    //Get the first slide from the presentation
    ISlide slide = presentation.Slides[0];
    //Get the oleObject from the slide
    IOleObject oleObject = (IShape)slide.Shapes[0] as IOleObject;
    //Gets the embedded OLE object data
    byte[] array = oleObject.ObjectData;
    //Save the extracted OLE data into file system.
    MemoryStream memoryStream = new MemoryStream(array);
    FileStream fileStream = File.Create("OleFile.docx");
    memoryStream.CopyTo(fileStream);
    memoryStream.Dispose();
    fileStream.Dispose();
    //Close the Presentation
    presentation.Close();
    'Load a PowerPoint presentation
     Dim presentation As IPresentation = Syncfusion.Presentation.Presentation.Open("Sample.pptx")
     'Get the first slide from the presentation
     Dim slide As ISlide = presentation.Slides(0)
     'Get the oleObject from the slide
     Dim oleObject As IOleObject = CType(CType(slide.Shapes(0), IOleObject), IShape)
     'Gets the embedded OLE object data
     Dim array() As Byte = oleObject.ObjectData
     'Save the extracted OLE data into file system.
     Dim memoryStream As MemoryStream = New MemoryStream(array)
     Dim fileStream As FileStream = File.Create("OleFile.docx")
     memoryStream.CopyTo(fileStream)
     memoryStream.Dispose
     fileStream.Dispose
     'Close the Presentation
     presentation.Close()

    ProgID

    Gets the programmatic identifier (ProgID) for the specified OLE object.

    Declaration
    string ProgID { get; }
    Property Value
    Type Description
    System.String

    The string that specifies the type of the OLE object.

    Examples
    //Load a PowerPoint presentation
    IPresentation presentation = Presentation.Open("Sample.pptx");
    //Get the first slide from the presentation
    ISlide slide = presentation.Slides[0];
    //Get the oleObject from the slide
    IOleObject oleObject = (IShape)slide.Shapes[0] as IOleObject;
    //Gets the embedded OLE object type
    string objectType = oleObject.ProgID;
    //Close the Presentation
    presentation.Close();
    'Load a PowerPoint presentation
     Dim presentation As IPresentation = Syncfusion.Presentation.Presentation.Open("Sample.pptx")
     'Get the first slide from the presentation
     Dim slide As ISlide = presentation.Slides(0)
     'Get the oleObject from the slide
     Dim oleObject As IOleObject = CType(CType(slide.Shapes(0), IOleObject), IShape)
     'Gets the embedded OLE object type
     Dim objectType As String = oleObject.ProgID
     'Close the Presentation
     presentation.Close()
    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved