Back to Devexpress

SubDocument.GetSubDocumentType() Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-subdocument-85fa42b1.md

latest3.5 KB
Original Source

SubDocument.GetSubDocumentType() Method

Returns the subdocument type.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
SubDocumentType GetSubDocumentType()
vb
Function GetSubDocumentType As SubDocumentType

Returns

TypeDescription
SubDocumentType

A SubDocumentType enumeration member.

|

Remarks

Use the GetSubDocumentType method to obtain whither the current subdocument is the main document body, header, footer, comment, text box, footnote or endnote.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetSubDocumentType() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-richedit-layout-api-practical-usage/CS/WindowsFormsApplication1/DocumentLayoutHelper/RichEditDocumentLayoutAnalyzer.cs#L36

csharp
public static string GetInformationAboutCurrentDocumentElement(Document currentDocument, DocumentLayout currentDocumentLayout, SubDocument currentSubDocument, DocumentPosition docPosition) {
    if(currentSubDocument.GetSubDocumentType() == SubDocumentType.TextBox) {
        return TextBoxLayoutHelper.GetInformationAboutCurrentTextBox(currentSubDocument, currentDocumentLayout, docPosition);

winforms-richedit-layout-api-practical-usage/VB/WindowsFormsApplication1/DocumentLayoutHelper/RichEditDocumentLayoutAnalyzer.vb#L44

vb
End If
If currentSubDocument.GetSubDocumentType() = SubDocumentType.Main Then

See Also

SubDocument Interface

SubDocument Members

DevExpress.XtraRichEdit.API.Native Namespace