OleObject Class
Represents an OLE object or control within a presentation.
- Inheritance:
- System.ObjectOleObject
Properties
ContentType
Gets the content type of the OLE object data.
Property Value
- System.String
The content type of the OLE object data.
Data
Gets the data of the OLE object.
Property Value
- System.IO.MemoryStream
A System.IO.MemoryStream containing the OLE object data.
EmbeddedObjectName
Gets or sets the identifying name class used by scripting languages. This name is also used to construct the clipboard name.
Property Value
- System.String
The identifying name class used by scripting languages. This name is also used to construct the clipboard name.
Frame
Gets the graphic frame that contains this OLE object.
Property Value
The GraphicFrame that contains this OLE object.
ImageHeight
Gets or sets the height of the embedded control.
Property Value
ImageWidth
Gets or sets the width of the embedded control.
Property Value
IsLinked
Gets or sets a value indicating whether this object or control is linked.
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.
Property Value
- System.String
The link to the external object.
Path
Gets the path or link associated with the OLE object.
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 picture associated with the OLE object.
Property Value
ProgId
Gets or sets the program identifier (ProgId) associated with the OLE object.
Property Value
- System.String
The ProgId for the OLE object.
ShowAsIcon
Gets or sets a value indicating whether the OLE object is displayed as an icon or using its native representation.
Property Value
- System.Boolean
true if the OLE object is displayed as an icon; otherwise, false if it is displayed using its native representation.
UpdateMode
Gets or sets the update mode for the OLE object.
Property Value
The OleUpdateMode value indicating how the OLE object is updated.
Methods
SetData(Stream, String, String)
Sets the data for the OLE object from the specified stream.
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 OLE object data.
sourcePath
- System.String
The source path of the OLE 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.
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 OLE 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.
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.