All docs
V20.2
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

OleFormat.ChangeRepresentation(OleObjectRepresentationType, Image) Method

Changes the display style for the OLE object.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v20.2.Core.dll

Declaration

void ChangeRepresentation(
    OleObjectRepresentationType drawAspect,
    Image presentation
)
Sub ChangeRepresentation(
    drawAspect As OleObjectRepresentationType,
    presentation As Image
)

Parameters

Name Type Description
drawAspect OleObjectRepresentationType

An enumeration member that specifies how the OLE object should be displayed in the document (as an image or an icon).

presentation Image

A new image or icon for the OLE object.

Remarks

The following example shows how to use an icon instead of an image to display an OLE object in the document:

Document document = wordProcessor.Document;
// Insert an OLE object. Link it to an Excel worksheet.
// The OLE object is displayed in the document as an image.
Shape oleObject = document.Shapes.InsertOleObject(document.CreatePosition(1780), @"D:\ExcelWorkbook.xlsx",
    OleObjectType.ExcelWorksheet, System.Drawing.Image.FromFile(@"Images\Spreadsheet.png"));

// Display the OLE object as an icon.
oleObject.OleFormat.ChangeRepresentation(OleObjectRepresentationType.Icon, 
    System.Drawing.Image.FromFile(@"Images\Excel.ico"));
See Also