Back to Devexpress

Section.EndUpdateFooter(SubDocument) Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-section-dot-endupdatefooter-x28-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-subdocument-x29.md

latest7.3 KB
Original Source

Section.EndUpdateFooter(SubDocument) Method

Finalizes editing of the section’s footer.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

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

Parameters

NameTypeDescription
documentSubDocument

A SubDocument instance, representing the footer opened for editing.

|

Remarks

Use the Section.BeginUpdateFooter - Section.EndUpdateFooter method pair to edit footer content.

Example

View Example

csharp
Document document = server.Document;
document.AppendSection();
Section firstSection = document.Sections[0];
// Modify the header of the HeaderFooterType.First type.
SubDocument myHeader = firstSection.BeginUpdateHeader(HeaderFooterType.First);
DocumentRange range = myHeader.InsertText(myHeader.CreatePosition(0), " PAGE NUMBER ");
Field fld = myHeader.Fields.Create(range.End, "PAGE \\* ARABICDASH");
myHeader.Fields.Update();
firstSection.EndUpdateHeader(myHeader);
// Display the header of the HeaderFooterType.First type on the first page.
firstSection.DifferentFirstPage = true;
vb
Dim document As Document = server.Document
document.AppendSection()
Dim firstSection As Section = document.Sections(0)
' Modify the header of the HeaderFooterType.First type.
Dim myHeader As SubDocument = firstSection.BeginUpdateHeader(HeaderFooterType.First)
Dim range As DocumentRange = myHeader.InsertText(myHeader.CreatePosition(0), " PAGE NUMBER ")
Dim fld As Field = myHeader.Fields.Create(range.End, "PAGE \* ARABICDASH")
myHeader.Fields.Update()
firstSection.EndUpdateHeader(myHeader)
' Display the header of the HeaderFooterType.First type on the first page.
firstSection.DifferentFirstPage = True

The following code snippets (auto-collected from DevExpress Examples) contain references to the EndUpdateFooter(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/HeaderAndFooter.cs#L51

csharp
SubDocument newFooter = firstSection.BeginUpdateFooter();
firstSection.EndUpdateFooter(newFooter);
// Check whether the document already has a footer (the same footer for all pages).

word-processing-merge-documents-with-different-headers-and-footers/CS/Helpers/SectionsMerger.cs#L54

csharp
sourceSection.EndUpdateFooter(source);
targetSection.EndUpdateFooter(target);

winforms-richedit-iterate-through-all-sub-documents/CS/SubDocumentHelper.cs#L39

csharp
ProcessShapes(footer.Shapes, subDocumentProcessor);
    section.EndUpdateFooter(footer);
}

office-file-api-ai-implementation/CS/BusinessObjects/RichEditExtension.cs#L25

csharp
UpdateSubDocument(footer, action);
    section.EndUpdateFooter(footer);
}

word-document-api-iterate-through-all-sub-documents/CS/SubDocumentHelper.cs#L39

csharp
ProcessShapes(footer.Shapes, subDocumentProcessor);
    section.EndUpdateFooter(footer);
}

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/HeaderAndFooter.vb#L46

vb
Dim newFooter As DevExpress.XtraRichEdit.API.Native.SubDocument = firstSection.BeginUpdateFooter()
firstSection.EndUpdateFooter(newFooter)
' Check whether the document already has a footer (the same footer for all pages).

word-processing-merge-documents-with-different-headers-and-footers/VB/Helpers/SectionsMerger.vb#L48

vb
target.Delete(emptyParagraph)
sourceSection.EndUpdateFooter(source)
targetSection.EndUpdateFooter(target)

word-document-api-insert-inline-pictures/VB/InlinePictures/Program.vb#L46

vb
docFooter.Images.Append(barCode.BarCodeImage)
            doc.Sections(0).EndUpdateFooter(docFooter)
'#End Region ' #inlinepictures

winforms-richedit-iterate-through-all-sub-documents/VB/SubDocumentHelper.vb#L34

vb
ProcessShapes(footer.Shapes, subDocumentProcessor)
    section.EndUpdateFooter(footer)
End If

word-document-api-iterate-through-all-sub-documents/VB/SubDocumentHelper.vb#L34

vb
ProcessShapes(footer.Shapes, subDocumentProcessor)
    section.EndUpdateFooter(footer)
End If

See Also

Section Interface

Section Members

DevExpress.XtraRichEdit.API.Native Namespace