3 points

Retrieving Fields in Open XML WordprocessingML Documents | Eric White


dashboard

Sun Jun 21 2020 06:38:54 GMT+0000 (UTC)

Posted 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_copy Copy

Fill fields in OPEN XML

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