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); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter