Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

OlePackage.FileName Property

Gets or sets the OLE Package file name.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Package: DevExpress.RichEdit.Core

#Declaration

string FileName { get; set; }

#Property Value

Type Description
String

The source file name.

#Example

The following example embeds an OLE package in the document. The OLE package contains compressed files in the zip archive format.

Activate an OLE Package

using DevExpress.XtraRichEdit.API.Native;
using System.IO;
using System.Drawing;
// ...

Document document = wordProcessor.Document;
// Embed a zip archive in the document.
// Display the OLE object as an icon.
using (Stream zipStream = File.Open(@"D:\Attachment.zip", FileMode.Open))
{
    Shape oleObject = document.Shapes.InsertOleObjectAsIcon(document.Range.Start, zipStream,
        OleObjectType.Package, DocumentImageSource.FromFile(@"Images\Package.ico"));
    oleObject.OleFormat.OlePackage.FileName = "D:\\Attachment.zip";
    oleObject.OleFormat.OlePackage.DisplayName = "DocumentAttachment.zip";
     // Specify the object position on the page.
    oleObject.RelativeHorizontalPosition = ShapeRelativeHorizontalPosition.Column;
    oleObject.RelativeVerticalPosition = ShapeRelativeVerticalPosition.Paragraph;
    oleObject.Offset = new PointF(0, 0);
}
See Also