Skip to main content

Document.DocumentProperties Property

Provides access to the collection of document’s core properties.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation

Declaration

DocumentProperties DocumentProperties { get; }

Property Value

Type Description
DocumentProperties

A DocumentProperties object that stores the document’s core properties.

Remarks

The following table lists the built-in document properties supported in different formats:

DOCX DOTX DOCM DOTM RTF DOC DOT WordML ODT HTML XML
Application yes yes yes yes yes yes yes no yes no yes
AppVersion yes yes yes yes yes yes yes no yes no no
Category yes yes yes yes yes yes yes yes no no yes
ContentStatus yes yes yes yes no yes yes no no no yes
ContentType yes yes yes yes no no no no no no yes
Company yes yes yes yes yes yes yes no yes no yes
Created yes yes yes yes yes yes yes yes yes no yes
Creator yes yes yes yes yes yes yes yes yes no yes
Description yes yes yes yes yes yes yes yes yes no yes
Identifier yes yes yes yes no no no no no no yes
Keywords yes yes yes yes yes yes yes yes yes no yes
Language yes yes yes yes no yes yes no no no yes
LastModifiedBy yes yes yes yes yes yes yes yes yes no yes
LastPrinted yes yes yes yes yes yes yes yes yes no yes
Manager yes yes yes yes yes yes yes no yes no yes
Modified yes yes yes yes yes yes yes yes yes no yes
Revision yes yes yes yes yes yes yes yes yes no yes
Subject yes yes yes yes yes yes yes yes yes no yes
Template yes yes yes yes yes yes yes yes yes no yes
Title yes yes yes yes yes yes yes no yes yes yes
Version yes yes yes yes no yes yes no no no yes

Example

View Example: Word Processing Document API – How to Process Word Documents in Code

This code snippet demonstrates how to set standard document properties and show them in a document using specific fields. The FieldCollection.Update method updates all property fields in the document body.

Note

If the DOCPROPERTY fields are located in the text box, header or footer, they should be updated separately. Use the Section.BeginUpdateHeader - Section.EndUpdateHeader or Section.BeginUpdateFooter - Section.EndUpdateFooter paired methods to obtain the header or footer. The TextBox.Document property allows you to retrieve the text box content and update the corresponding fields.

using XtraRichEdit.API.Native;
//...

using (var wordProcessor = new RichEditDocumentServer()) {
    wordProcessor.CreateNewDocument();
    Document document = wordProcessor.Document;
    document.BeginUpdate();

    document.DocumentProperties.Creator = "John Doe";
    document.DocumentProperties.Title = "Inserting Custom Properties";
    document.DocumentProperties.Category = "TestDoc";
    document.DocumentProperties.Description = "This code demonstrates API to modify and display standard document properties.";

    document.Fields.Create(document.AppendText("\nAUTHOR: ").End, "AUTHOR");
    document.Fields.Create(document.AppendText("\nTITLE: ").End, "TITLE");
    document.Fields.Create(document.AppendText("\nCOMMENTS: ").End, "COMMENTS");
    document.Fields.Create(document.AppendText("\nCREATEDATE: ").End, "CREATEDATE");
    document.Fields.Create(document.AppendText("\nCategory: ").End, "DOCPROPERTY Category");
    document.Fields.Update();
    document.EndUpdate();
}
See Also