Update fields (W)

Modified on Mon, 5 Oct at 1:54 PM

BaseExtensions can be used to update fields in Word. This feature updates table of contents, table of figures, all story ranges fields (almost all types) as well as all fields inside tables. In this way, our feature does a bunch of extra updates than Office's native functionality, for which reason it may take some extra time to complete the update.

Modules are located here:

Code
...\ModuleLibrary\BaseExtensions\01_nocontext_Tools\14_W_updateFields.xml

CMD

<Cmd case="BaseExtensions:update-fields"/>

Extended version

We have implemented an extended version of the functionality to update fields where we are able to target both location in document and type of field in document that should be updated. In this way, we can improve the flow of updating fields.

CMD

<Cmd case="BaseExtensions:update-fields-2" location="X" types="Y"/>

Parameters

location

Define the location that should be targeted for the update. We support the following options:

  • Body - targets the fields of specified type in the body of the document (headers and footers are excluded)
  • Headers - targets the fields of specified type in headers only.
  • Footers - targets the fields of specified type in footers only.

If this parameter is set to null or omitted, it will target all locations in document.

types

Define the type of fields that should be updated. It has to be a field type from this list. Multiple field types can be defined by separating them by a ;. See example below.

If this parameter is set to null or omitted, it will target all field types.

IncludeShapes

Define whether or not text ranges within shapes should be checked for fields. The parameter can be set to true (default) or false and it was implemented to decrease start-up time of large documents that include multiple shapes.

Example of usage

XML
<Cmd case="BaseExtensions:update-fields-2" location="Footers" types="wdFieldCreateDate;wdFieldFileName;wdFieldUserInitials"/>

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article