Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Collapse]Rich Text Editor
    Overview
   [Expand]Getting Started
   [Collapse]Fundamentals
    [Expand]RichEditControl
    [Collapse]Document
      Document Model
      Document Layout
      Positions and Ranges
      Characters
      Paragraphs
      Inline Pictures
      Document Fields
      Hyperlinks and Bookmarks
      Headers and Footers
      Tables
      Range Permissions
      Sections
      Styles
      Numbered and Bulleted Lists
      Floating Objects (Shapes)
      Text Boxes
      Comments
      Document Properties
     Supported Document Formats
    [Expand]Fields
     Commands
     Services
     Layout API
     Product Class Structure
     Default Keyboard Shortcuts
     Measure Units
     HTML Tag Interpretation
   [Expand]Concepts
   [Expand]Visual Elements
   [Expand]Examples
   [Expand]Member Tables
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Document Properties

RichEditControl allows you to provide a document with additional information about its author, title, editor, etc. These details are represented by document properties - metadata stored with the document.
Standard ECMA-376 (Edition 1) divides document properties into three categories: Core, Extended, and Custom. Rich Text Editor recognizes Core properties as the document's built-in properties, and both Extended and Custom properties - as custom properties. Document metadata is accessible both in code and in the User Interface.

Expanded Built-In Properties

Built-in document properties are represented by the DocumentProperties instance. To set these attributes, use the following API.

Member Description
SubDocument.BeginUpdate Enables document modification.
Document.DocumentProperties Provides access to the collection of document properties.
SubDocument.EndUpdate Finishes document update.

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E5219.

This code snippet demonstrates how to set standard document properties and show them in a document using specific fields.

Expanded Custom Properties

Custom properties in the RichEditControl document are represented by the DocumentCustomProperties instance. The API from the table below allows you to set custom properties for your document.

Member Description
SubDocument.BeginUpdate Enables document modification.
Document.CustomProperties Provides access to the collection of custom document properties.
DocumentCustomProperties.Add Adds a new custom property with a given name and value to the document collection.
DocumentCustomProperties.Item Sets a value of a custom property. If the property with the specified name does not exist, RichEditControl creates it automatically.
SubDocument.EndUpdate Finishes the document update.

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E5219.

The following code illustrates how to create custom document properties and place them in the document's storage. The DOCPROPERTY field is used to display property values in the document.


Tip

To set what document properties are going to be exported, use the DocumentExporterOptions.ExportedDocumentProperties property.

Expanded Document Properties in the User Interface

End-users can specify both built-in and custom properties using the Document Properties Dialog (invoked from the File ribbon tab). To learn how to provide the application with the Ribbon UI, refer to the How to: Create a Simple Word Processor with a Ribbon UI topic.

To display document properties in the document, use special fields, the DOCPROPERTY field or a combination of the DOCVARIABLE field and the RichEditControl.CalculateDocumentVariable event handler.

Expanded See Also

How would you rate this topic?​​​​​​​