Skip to content

Commit cd2d0f1

Browse files
committed
addressed feedback
1 parent 32723d0 commit cd2d0f1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

knowledge-base/update-toc-radwordsprocessing-before-docx-export.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Updating TOC Page Numberings in Word Documents Before Exporting to DOCX Format
33
description: Learn how to update the Table of Contents (TOC) in a Word document using RadWordsProcessing before exporting to DOCX format.
44
type: how-to
5-
page_title: How to TOC Page Numberings in Word Documents Before Exporting to DOCX Format
5+
page_title: How to Update TOC Page Numberings in Word Documents Before Exporting to DOCX Format
66
slug: update-toc-radwordsprocessing-before-docx-export
77
tags: wordsprocessing, document, processing, toc, table, contents, update, fields, docx, export
88
res_type: kb
@@ -40,6 +40,14 @@ document.UpdateFields();
4040

4141
By setting the `NumberingFieldsProvider` and then calling `RadFlowDocument.UpdateFields()`, the document will update the TOC to reflect the correct page numbering.
4242

43+
It is possible to [update just a single field](https://docs.telerik.com/devtools/document-processing/libraries/radwordsprocessing/concepts/fields/fields#updating-fields), not all of them:
44+
45+
```csharp
46+
FieldCharacter fieldCharacter = document.EnumerateChildrenOfType<FieldCharacter>().First(x=> x.FieldInfo.Field is TocField);
47+
FieldInfo fieldInfo = fieldCharacter.FieldInfo;
48+
fieldInfo.UpdateField();
49+
```
50+
4351
4. With the TOC updated, you can now proceed to export the document to DOCX format, confident that the TOC displays the correct page references.
4452

4553
## Notes

0 commit comments

Comments
 (0)