Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

Section.BeginUpdateHeader() Method

Starts editing the primary header for the current section.

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

SubDocument BeginUpdateHeader()

Returns

Type Description
SubDocument

A SubDocument instance that is the header being edited.

Remarks

Use the Section.BeginUpdateHeader - Section.EndUpdateHeader method pair to edit primary (the HeaderFooterType.Primary type) header content. If the document has no header as yet, this method creates a header of the HeaderFooterType.Primary type and opens it for editing.

You can use the Section.HasHeader property to determine whether the document already has a header which is the same for all pages (a header of the HeaderFooterType.Primary type).

Example

Dim firstSection As Section = document.Sections(0)
' Create an empty header.
Dim newHeader As SubDocument = firstSection.BeginUpdateHeader()
firstSection.EndUpdateHeader(newHeader)
' Check whether the document already has a header (the same header for all pages).
If firstSection.HasHeader(HeaderFooterType.Primary) Then
    Dim headerDocument As SubDocument = firstSection.BeginUpdateHeader()
    document.ChangeActiveDocument(headerDocument)
    document.CaretPosition = headerDocument.CreatePosition(0)
    firstSection.EndUpdateHeader(headerDocument)
End If

The following code snippets (auto-collected from DevExpress Examples) contain references to the BeginUpdateHeader() 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.

See Also