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.ChangeActiveDocument(SubDocument) Method

Enables you to operate on selections in documents other than the main document, such as headers and footers.

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

void ChangeActiveDocument(SubDocument document)
Sub ChangeActiveDocument(document As SubDocument)
void ChangeActiveDocument(SubDocument document)
Sub ChangeActiveDocument(document As SubDocument)

Parameters

Name Type Description
document SubDocument

A SubDocument object that is the document that is different from the currently active document.

Parameters

Name Type Description
document SubDocument

A SubDocument object that is the document that is different from the currently active document.

Remarks

The following code snippet demonstrates how you can select a bookmark in the header. Note that the use of the ChangeActiveDocument is mandatory, otherwise the BookmarkCollection.Select method will fail.


// Find the bookmark.
SubDocument myDoc = richEditControl1.Document.Sections[0].BeginUpdateHeader(HeaderFooterType.Even);
Bookmark bmark = myDoc.Bookmarks[0];            
richEditControl1.Document.Sections[0].EndUpdateHeader(myDoc);
// Select the bookmark.
SubDocument subDoc = bmark.Range.BeginUpdateDocument();
richEditControl1.Document.ChangeActiveDocument(subDoc);
subDoc.Bookmarks.Select(bmark);
bmark.Range.EndUpdateDocument(subDoc);
See Also