Document.DocumentProperties Property
Provides access to the collection of document’s core properties.
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v19.1.Core.dll
Declaration
Property Value
Type | Description |
---|---|
DocumentProperties | A DocumentProperties object that stores the document’s core properties. |
Example
Note
A complete sample project is available at https://github.com/DevExpress-Examples/word-processing-document-api-examples-t418535
server.CreateNewDocument();
Document document = server.Document;
document.BeginUpdate();
document.Fields.Create(document.AppendText("\nMyNumericProperty: ").End, "DOCVARIABLE CustomProperty MyNumericProperty");
document.Fields.Create(document.AppendText("\nMyStringProperty: ").End, "DOCVARIABLE CustomProperty MyStringProperty");
document.Fields.Create(document.AppendText("\nMyBooleanProperty: ").End, "DOCVARIABLE CustomProperty MyBooleanProperty");
document.EndUpdate();
document.CustomProperties.Add("MyNumericProperty", 123.45);
document.CustomProperties.Add("MyStringProperty", "The Final Answer");
document.CustomProperties.Add("MyBooleanProperty", true);
server.CalculateDocumentVariable += DocumentPropertyDisplayHelper.OnCalculateDocumentVariable;
document.Fields.Update();
See Also