The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

Document.CustomProperties Property

Provides access to a collection of the document's custom properties.

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

DocumentCustomProperties CustomProperties { get; }
ReadOnly Property CustomProperties As DocumentCustomProperties
DocumentCustomProperties CustomProperties { get; }
ReadOnly Property CustomProperties As DocumentCustomProperties

Property Value

Type Description
DocumentCustomProperties

A DocumentCustomProperties object that stores document's custom properties.

Property Value

Type Description
DocumentCustomProperties

A DocumentCustomProperties object that stores document's custom properties.

Examples

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. Calling the FieldCollection.Update 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.

document.BeginUpdate()
document.AppendText("A new value of MyBookmarkProperty is obtained from here: NEWVALUE!" & vbLf)
document.Bookmarks.Create(document.FindAll("NEWVALUE!", SearchOptions.CaseSensitive)(0), "bmOne")
document.AppendText(vbLf & "MyNumericProperty: ")
document.Fields.Create(document.Range.End, "DOCPROPERTY ""MyNumericProperty""")
document.AppendText(vbLf & "MyStringProperty: ")
document.Fields.Create(document.Range.End, "DOCPROPERTY ""MyStringProperty""")
document.AppendText(vbLf & "MyBooleanProperty: ")
document.Fields.Create(document.Range.End, "DOCPROPERTY ""MyBooleanProperty""")
document.AppendText(vbLf & "MyBookmarkProperty: ")
document.Fields.Create(document.Range.End, "DOCPROPERTY ""MyBookmarkProperty""")
document.EndUpdate()

document.CustomProperties("MyNumericProperty")= 123.45
document.CustomProperties("MyStringProperty")="The Final Answer"
document.CustomProperties("MyBookmarkProperty") = document.Bookmarks(0)
document.CustomProperties("MyBooleanProperty")=True

document.Fields.Update()
See Also