OleFormat Class |
Namespace: Aspose.Words.Drawing
The OleFormat type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() | AutoUpdate |
Specifies whether the link to the OLE object is automatically updated or not in Microsoft Word.
|
![]() ![]() | Clsid |
Gets the CLSID of the OLE object.
|
![]() ![]() | IconCaption |
Gets icon caption of OLE object.
In case of OLE object is not embedded as icon or caption couldn't be retrieved returns empty string. |
![]() ![]() | IsLink |
Returns true if the OLE object is linked (when SourceFullName is specified).
|
![]() ![]() | IsLocked |
Specifies whether the link to the OLE object is locked from updates.
|
![]() ![]() | OleControl |
Gets OleControl objects if this OLE object is an ActiveX control. Otherwise this property is null.
|
![]() ![]() | OleIcon |
Gets the draw aspect of the OLE object. When true, the OLE object is displayed as an icon.
When false, the OLE object is displayed as content.
|
![]() ![]() | OlePackage |
Provide access to OlePackage if OLE object is an OLE Package.
Returns null otherwise.
|
![]() ![]() | ProgId |
Gets or sets the ProgID of the OLE object.
|
![]() ![]() | SourceFullName |
Gets or sets the path and name of the source file for the linked OLE object.
|
![]() ![]() | SourceItem |
Gets or sets a string that is used to identify the portion of the source file that is being linked.
|
![]() ![]() | SuggestedExtension |
Gets the file extension suggested for the current embedded object if you want to save it into a file.
|
![]() ![]() | SuggestedFileName |
Gets the file name suggested for the current embedded object if you want to save it into a file.
|
Name | Description | |
---|---|---|
![]() | Equals | (Inherited from Object.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() ![]() | GetOleEntry |
Gets OLE object data entry.
|
![]() ![]() | GetRawData |
Gets OLE object raw data.
|
![]() | GetType | (Inherited from Object.) |
![]() ![]() | Save(Stream) |
Saves the data of the embedded object into the specified stream.
|
![]() ![]() | Save(String) |
Saves the data of the embedded object into a file with the specified name.
|
![]() | ToString | (Inherited from Object.) |
Use the OleFormat property to access the data of an OLE object. You do not create instances of the OleFormat class directly.
Document doc = new Document(MyDir + "OLE spreadsheet.docm"); // The first shape will contain an OLE object Shape shape = (Shape)doc.GetChild(NodeType.Shape, 0, true); // This object is a Microsoft Excel spreadsheet OleFormat oleFormat = shape.OleFormat; Assert.AreEqual("Excel.Sheet.12", oleFormat.ProgId); // Our object is neither auto updating nor locked from updates Assert.False(oleFormat.AutoUpdate); Assert.AreEqual(false, oleFormat.IsLocked); // If we want to extract the OLE object by saving it into our local file system, this property can tell us the relevant file extension Assert.AreEqual(".xlsx", oleFormat.SuggestedExtension); // We can save it via a stream using (FileStream fs = new FileStream(ArtifactsDir + "OLE spreadsheet extracted via stream" + oleFormat.SuggestedExtension, FileMode.Create)) { oleFormat.Save(fs); } // We can also save it directly to a file oleFormat.Save(ArtifactsDir + "OLE spreadsheet saved directly" + oleFormat.SuggestedExtension);