Nested Fields

Home Forums WordprocessingML Nested Fields


This topic contains 2 replies, has 2 voices, and was last updated by  Manu_TR 5 months, 1 week ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #4087



    Is there a way to identify the end of Nested field code? because we usually find the nested field codes inside TOCs field which has been very difficult for us to programmatically identify its end.

    please help!



    Eric White

    Hi Manu,

    Whenever dealing with fields, and certainly nested fields, I use the FieldRetriever.cs module in Open-Xml-PowerTools. This module retrieves (in nested form) all fields in a DOCX. Further, auxiliary information is in the data structures returned by FieldRetriever, such as object references to the various markup elements in the main document part. You can use those object references to alter / query the document.

    The FieldRetriever module serves two purposes – it provides nicely packaged functionality to C# developers to understand the fields in a document, including nested fields. Further, it provides a reference implementation regarding the correct approach for retrieving the instrText and the representation of fields in a document.

    Please watch screen-casts #14 and #15 in the following series:

    Introduction to WordprocessingML

    Cheers, Eric



    Thanks Eric this was very helpful!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.