Class OleShape
Represents an embedded or linked OLE object in a spreadsheet shape.
Inherited Members
Namespace: DRIT.Spreadsheet.Drawing
Assembly: DRIT.Spreadsheet.dll
Syntax
public class OleShape : AbstractShape, IWorksheetDrawingObject, ISheetDrawingObject, IDrawingObject
Constructors
OleShape()
Initializes a new OleShape for the supplied workbook data.
Declaration
public OleShape()
Properties
DisplayName
Specifies the display name shown for this OLE object.
Declaration
public string DisplayName { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ProgId
Specifies the ProgId of the OLE object (e.g. "Excel.Sheet.12", "Package").
Declaration
public string ProgId { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
ClearEmbeddedContent()
Clears the embedded OLE binary payload so that no embedding part is written on the next save. The preview image (if any) is not affected.
Declaration
public void ClearEmbeddedContent()
GetEmbeddedBytes()
Returns the embedded OLE bytes, or null if none have been set.
Declaration
public byte[] GetEmbeddedBytes()
Returns
| Type | Description |
|---|---|
| byte[] |
GetPreviewBytes()
Returns the preview image bytes, or null if none have been set.
Declaration
public byte[] GetPreviewBytes()
Returns
| Type | Description |
|---|---|
| byte[] |
SetEmbeddedContent(byte[], string)
Embeds the OLE content from the supplied byte array.
Declaration
public void SetEmbeddedContent(byte[] bytes, string extension)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | bytes | Raw OLE compound document bytes. |
| string | extension | File extension including leading dot (e.g. ".xlsx", ".bin"). |
SetPreviewImage(byte[], string)
Sets the preview/thumbnail image shown while the OLE object is inactive.
Declaration
public void SetPreviewImage(byte[] bytes, string extension)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | bytes | Image bytes (PNG or JPEG recommended). |
| string | extension | File extension including leading dot (e.g. ".png", ".jpg"). |