Back to Devexpress

NoteCollection.EndUpdateSeparator(SubDocument) Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-notecollection-dot-endupdateseparator-x28-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-subdocument-x29.md

latest5.8 KB
Original Source

NoteCollection.EndUpdateSeparator(SubDocument) Method

Finalizes the separator update.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
void EndUpdateSeparator(
    SubDocument document
)
vb
Sub EndUpdateSeparator(
    document As SubDocument
)

Parameters

NameTypeDescription
documentSubDocument

The separator opened for editing.

|

Remarks

Use the NoteCollection.BeginUpdateSeparator - NoteCollection.EndUpdateSeparator paired methods to update one of the note separators (separator, continuation separator, or continuation notice).

If the document does not contain the specified separator, the NoteCollection.BeginUpdateSeparator method call creates a new separator. Call the NoteCollection.HasSeparator method to determine whether notes already have a specified separator type.

The code sample below shows how to change the footnote separator:

csharp
RichEditDocumentServer wordProcessor = new RichEditDocumentServer();
wordProcessor.LoadDocument("Documents//Grimm.docx");
Document document = wordProcessor.Document;
if (document.Footnotes.HasSeparator(NoteSeparatorType.Separator))
{
    SubDocument noteSeparator = document.Footnotes.BeginUpdateSeparator(NoteSeparatorType.Separator);
    noteSeparator.Delete(noteSeparator.Range);
    noteSeparator.AppendText("***");
    document.Footnotes.EndUpdateSeparator(noteSeparator);
}
vb
Dim wordProcessor As RichEditDocumentServer = New RichEditDocumentServer()
wordProcessor.LoadDocument("Documents//Grimm.docx")
Dim document As Document = wordProcessor.Document

If document.Footnotes.HasSeparator(NoteSeparatorType.Separator) Then
    Dim noteSeparator As SubDocument = document.Footnotes.BeginUpdateSeparator(NoteSeparatorType.Separator)
    noteSeparator.Delete(noteSeparator.Range)
    noteSeparator.AppendText("***")
    document.Footnotes.EndUpdateSeparator(noteSeparator)
End If

The following code snippets (auto-collected from DevExpress Examples) contain references to the EndUpdateSeparator(SubDocument) 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-document-api/CS/RichEditAPISample/CodeExamples/Notes.cs#L111

csharp
//Finalize the update:
    document.Footnotes.EndUpdateSeparator(noteSeparator);
}

wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/NotesActions.cs#L107

csharp
//Finalize the update:
    document.Footnotes.EndUpdateSeparator(noteSeparator);
}

word-document-api-examples/CS/CodeExamples/NotesActions.cs#L137

csharp
// Finalize to update the footnote separator.
    document.Footnotes.EndUpdateSeparator(noteSeparator);
}

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Notes.vb#L81

vb
'Finalize the update:
    document.Footnotes.EndUpdateSeparator(noteSeparator)
End If

wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/NotesActions.vb#L97

vb
'Finalize the update:
    document.Footnotes.EndUpdateSeparator(noteSeparator)
End If

word-document-api-examples/VB/CodeExamples/NotesActions.vb#L109

vb
' Finalize to update the footnote separator.
    document.Footnotes.EndUpdateSeparator(noteSeparator)
End If

See Also

NoteCollection Interface

NoteCollection Members

DevExpress.XtraRichEdit.API.Native Namespace