Back to Devexpress

Document Properties Dialog

windowsforms-116020-controls-and-libraries-rich-text-editor-visual-elements-dialogs-document-properties-dialog.md

latest7.5 KB
Original Source

Document Properties Dialog

  • Dec 16, 2021
  • 2 minutes to read

The Document Properties dialog enables end-users to view and modify document metadata accessible with the Document.DocumentProperties and Document.CustomProperties properties.

End-users can invoke this dialog by clicking Document Properties on the Home ribbon tab. Refer to the How to: Create the RichEditControl with a Ribbon UI topic for details on how to provide the Ribbon UI for the RichEditControl. Executing the ShowDocumentPropertiesFormCommand command invokes this dialog as well.

Before a dialog is shown, the RichEditControl.DocumentPropertiesFormShowing event occurs.

The dialog contains the following tabs:

  1. General
  2. Summary
  3. Statistics
  4. Custom

General

The General tab allows end-users to view properties of the document file.

Summary

The Summary tab allows end-users to edit several built-in document properties.

Dialog FieldDocument FieldDocument Property
TitleTITLEDocumentProperties.Title
SubjectSUBJECTDocumentProperties.Subject
AuthorAUTHORDocumentProperties.Author
ManagerDOCPROPERTY ManagerDocumentProperties.Manager
CompanyDOCPROPERTY CompanyDocumentProperties.Company
CategoryDOCPROPERTY CategoryDocumentProperties.Category
KeywordsKEYWORDSDocumentProperties.Keywords
CommentsCOMMENTSDocumentProperties.Description
TemplateTEMPLATEDocumentProperties.Template

Statistics

The Statistics tab allows end-users to view certain document properties.

Dialog FieldDocument FieldDocument Property
CreatedCREATEDATEDocumentProperties.Created
ModifiedSAVEDATEDocumentProperties.Modified
PrintedPRINTDATEDocumentProperties.LastPrinted
Last saved byLASTSAVEDBYDocumentProperties.LastModifiedBy
Revision numberREVNUMDocumentProperties.Revision

Custom

The Custom tab allows end-users to add and edit custom document properties.

Custom properties are contained in the Document.CustomProperties collection. To insert a custom property value in the document, insert the DOCVARIABLE field and handle the RichEditControl.CalculateDocumentVariable event. In the event handler, obtain a custom property value and assign it to the CalculateDocumentVariableEventArgs.Value property.

Dialog FieldAPI
NameA string used to retrieve a property from the Document.CustomProperties collection. The DocumentCustomProperties.Names property enables you to iterate over custom property names in a document.
TypeThe type of the custom property for display in the dialog. The DocumentCustomProperties.Item property returns the value of a custom property as a System.Object type and you can use the Object.GetType() method to determine its value type.
ValueUse the DocumentCustomProperties.Item property to obtain a custom property value.
Link to contentWhen checked, the Value field specifies a name of the bookmark whose content is extracted to set the value of a custom property. Assign a Bookmark object instead of any value to the custom document property using the DocumentCustomProperties.Item member to create a link to bookmark.
PropertiesA list of all DocumentCustomProperties.