Retrieving Fields in Open XML WordprocessingML Documents | Eric White

PHOTO EMBED

Sun Jun 21 2020 06:38:54 GMT+0000 (Coordinated Universal Time)

Saved by @ourexpertize

static void Main(string[] args)
{
    using (WordprocessingDocument doc =
        WordprocessingDocument.Open(“Test.docx”, false))
    {
        foreach (var f in doc.MainDocumentPart.Fields())
            Console.WriteLine(“Id: {0} InstrText: {1}”, f.Id, f.InstrText);
    }
}
content_copyCOPY

Fill fields in OPEN XML

http://www.ericwhite.com/blog/retrieving-fields-in-open-xml-wordprocessingml-documents/