Back to Devexpress

Document.UpdateAllFields() Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-document-6f90305e.md

latest3.3 KB
Original Source

Document.UpdateAllFields() Method

Updates all fields in the document.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
void UpdateAllFields()
vb
Sub UpdateAllFields

Remarks

Use the Field.Update method to update a field. The FieldCollection.Update method allows you to update all fields in specific parts of a document (main body, text box, header, footer, comment, footnote, and endnote).

The code sample below updates all fields in the document.

csharp
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;
//...

using (RichEditDocumentServer wordProcessor = new RichEditDocumentServer())
{
    // Access a document.
    Document document = wordProcessor.Document;
    //...
    // Update all fields in the document.
    document.UpdateAllFields();
}
vb
Imports DevExpress.XtraRichEdit
Imports DevExpress.XtraRichEdit.API.Native
'...

Using wordProcessor As New RichEditDocumentServer()
    ' Access a document.
    Dim document As Document = wordProcessor.Document
    '...
    ' Update all fields in the document.
    document.UpdateAllFields()
End Using

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the UpdateAllFields() 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.

word-document-api-use-printablecomponentlink-to-print-document/CS/PrintingSystem/Form1.cs#L32

csharp
// Update fields
srv.Document.UpdateAllFields();
// Create a printable link to print a document.

word-document-api-use-printablecomponentlink-to-print-document/VB/PrintingSystem/Form1.vb#L32

vb
' Update fields
srv.Document.UpdateAllFields()
' Create a printable link to print a document.

See Also

Document Interface

Document Members

DevExpress.XtraRichEdit.API.Native Namespace