GemBox.Document
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    OleObject Class

    Namespace:
    GemBox.Document
    Assembly:
    GemBox.Document.dll

    Represents an OLE (Object Linking and Embedding) object embedded or linked within a document.

    • C#
    • VB.NET
    public class OleObject : Inline
    Public Class OleObject
        Inherits Inline
    Inheritance:
    System.Object
    Element
    Inline
    OleObject

    Constructors

    OleObject(DocumentModel, Stream, String, Layout, String)

    Initializes a new instance of the OleObject class with the specified document, stream, path, layout, and content type.

    • C#
    • VB.NET
    public OleObject(DocumentModel document, Stream stream, string originalPathOrFileName, Layout layout, string explicitContentType = null)
    Public Sub New(document As DocumentModel, stream As Stream, originalPathOrFileName As String, layout As Layout, explicitContentType As String = Nothing)
    Parameters
    document
    DocumentModel

    The document model.

    stream
    System.IO.Stream

    The stream containing the embedded object data.

    originalPathOrFileName
    System.String

    The original path or file name of the embedded object.

    layout
    Layout

    The layout information.

    explicitContentType
    System.String

    The explicit content type, if any.

    OleObject(DocumentModel, String, Boolean, Layout, String)

    Initializes a new instance of the OleObject class with the specified document, path, link flag, layout, and content type.

    • C#
    • VB.NET
    public OleObject(DocumentModel document, string path, bool linked, Layout layout, string explicitContentType = null)
    Public Sub New(document As DocumentModel, path As String, linked As Boolean, layout As Layout, explicitContentType As String = Nothing)
    Parameters
    document
    DocumentModel

    The document model.

    path
    System.String

    The path to the embedded or linked object.

    linked
    System.Boolean

    Indicates whether the object should be linked (true) or embedded (false).

    layout
    Layout

    The layout information.

    explicitContentType
    System.String

    The explicit content type, if any.

    Properties

    ContentType

    Gets the content type of the embedded object data.

    • C#
    • VB.NET
    public string ContentType { get; }
    Public ReadOnly Property ContentType As String
    Property Value
    System.String

    The content type of the embedded object data.

    Data

    Gets the data of the embedded object.

    • C#
    • VB.NET
    public MemoryStream Data { get; }
    Public ReadOnly Property Data As MemoryStream
    Property Value
    System.IO.MemoryStream

    The data of the embedded object.

    ElementType

    Gets the element type for OleObject which is OleObject.

    • C#
    • VB.NET
    public override ElementType ElementType { get; }
    Public Overrides ReadOnly Property ElementType As ElementType
    Property Value
    ElementType

    The OleObject value.

    Overrides
    Element.ElementType

    IsLinked

    Gets or sets a value indicating whether this object or control is linked.

    • C#
    • VB.NET
    public bool IsLinked { get; }
    Public ReadOnly Property IsLinked As Boolean
    Property Value
    System.Boolean

    true if this object or control is linked; otherwise, false if it is embedded.

    Link

    Gets the link associated with the OLE object, if it is linked.

    • C#
    • VB.NET
    public string Link { get; }
    Public ReadOnly Property Link As String
    Property Value
    System.String

    OriginalImageHeight

    Gets or sets the original height of the image representing the OLE object.

    • C#
    • VB.NET
    public int? OriginalImageHeight { get; set; }
    Public Property OriginalImageHeight As Integer?
    Property Value
    System.Nullable<System.Int32>

    OriginalImageWidth

    Gets or sets the original width of the image representing the OLE object.

    • C#
    • VB.NET
    public int? OriginalImageWidth { get; set; }
    Public Property OriginalImageWidth As Integer?
    Property Value
    System.Nullable<System.Int32>

    Path

    Gets the path or link associated with the OLE object.

    • C#
    • VB.NET
    public string Path { get; }
    Public ReadOnly Property Path As String
    Property Value
    System.String
    Exceptions
    System.InvalidOperationException

    Thrown if the path cannot be determined if the object is linked with a null link.

    Picture

    Gets or sets the preview picture or the icon (ShowAsIcon) associated with the OLE object.

    • C#
    • VB.NET
    public Picture Picture { get; set; }
    Public Property Picture As Picture
    Property Value
    Picture

    The preview picture or the icon (ShowAsIcon) representing the OLE object.

    ProgId

    Gets the program identifier (ProgId) associated with the OLE object.

    • C#
    • VB.NET
    public string ProgId { get; }
    Public ReadOnly Property ProgId As String
    Property Value
    System.String

    ShowAsIcon

    Gets or sets a value indicating whether the object is displayed as an icon or using its native representation.

    • C#
    • VB.NET
    public bool ShowAsIcon { get; set; }
    Public Property ShowAsIcon As Boolean
    Property Value
    System.Boolean

    true if the object is displayed as an icon; otherwise, false if it is displayed using its native representation.

    UpdateMode

    Gets or sets the update type for the linked object.

    • C#
    • VB.NET
    public OleUpdateMode UpdateMode { get; set; }
    Public Property UpdateMode As OleUpdateMode
    Property Value
    OleUpdateMode

    Methods

    SetData(Stream, String, String)

    Sets the data for the OLE object from the specified stream.

    • C#
    • VB.NET
    public void SetData(Stream stream, string sourcePath, string explicitContentType = null)
    Public Sub SetData(stream As Stream, sourcePath As String, explicitContentType As String = Nothing)
    Parameters
    stream
    System.IO.Stream

    The stream containing the embedded object data.

    sourcePath
    System.String

    The source path of the embedded object.

    explicitContentType
    System.String

    The explicit content type, if any.

    Exceptions
    System.ArgumentNullException

    Thrown if stream or sourcePath is null.

    SetData(String, String)

    Sets the data for the OLE object from the specified file path.

    • C#
    • VB.NET
    public void SetData(string path, string explicitContentType = null)
    Public Sub SetData(path As String, explicitContentType As String = Nothing)
    Parameters
    path
    System.String

    The file path containing the embedded object data.

    explicitContentType
    System.String

    The explicit content type, if any.

    Exceptions
    System.ArgumentNullException

    Thrown if path is null.

    System.IO.FileNotFoundException

    Thrown if the file at path does not exist.

    SetLink(String, String, String)

    Sets the link for the OLE object.

    • C#
    • VB.NET
    public void SetLink(string link, string range = null, string explicitContentType = null)
    Public Sub SetLink(link As String, range As String = Nothing, explicitContentType As String = Nothing)
    Parameters
    link
    System.String

    The link to the external object.

    range
    System.String

    The range within the linked object, if any.

    explicitContentType
    System.String

    The explicit content type, if any.

    Exceptions
    System.ArgumentNullException

    Thrown if link is null.

    Inherited Properties

    Content

    Gets the content of the current Element.

    (Inherited from Element)

    Document

    Gets the owner document.

    (Inherited from Element)

    Parent

    Gets the parent of this Element instance.

    (Inherited from Element)

    ParentCollection

    Gets the InlineCollection that contains this Inline instance.

    (Inherited from Inline)

    Revision

    Gets or sets the revision information for the inline.

    (Inherited from Inline)

    Inherited Methods

    Clone(System.Boolean)

    Clones this Inline instance.

    (Inherited from Inline)

    GetChildElements(System.Boolean)

    Gets the child elements.

    (Inherited from Element)

    GetChildElements(System.Boolean, ElementType[])

    Gets the child elements filtered by ElementType.

    (Inherited from Element)

    GetParentElements()

    Gets the parent elements.

    (Inherited from Element)

    GetParentElements(ElementType[])

    Gets the parent elements.

    (Inherited from Element)

    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.