aspnetcore-401645-rich-edit-document-model.md
A document model defines the logical structure of a document. Use the document property to access the information about the model.
Document content is divided into parts, or sub-documents, available using the subDocuments property.
The RichEdit control supports the following sub-document types:
javascript//return the main sub-document richEdit.document.subDocuments.main;
javascriptvar section = richEdit.document.sections.getByIndex(0); var subDocument = section.getHeader(DevExpress.RichEdit.HeaderFooterType.Primary, true);
The document model includes information about every sub-document’s structural element. Use the following properties to access element collections.
| Elements | Property | Example |
|---|---|---|
| Bookmarks | bookmarks | richEdit.document.bookmarks.find("bookmarkName")[0].goTo(); |
| Fields | fields | richEdit.document.fields.updateAllFields(); |
| Hyperlinks | hyperlinks | richEdit.document.hyperlinks.create(hlPosition, {text: "Visit our site", url: "https://www.devexpress.com/"}); |
| Paragraphs | paragraphs | richEdit.document.paragraphs.create(richEdit.document.length - 1); |
| Tables | tables | richEdit.document.tables.create(tblPosition, 2, 3); |
See Also