I am writing a code in C# using Open XML SDK 2.0. I have defined some controls in Word document like TextBox, Select Option etc. I want to read their data programatically (sample given below)..
WordprocessingDocument InputWordDocument = WordprocessingDocument.Open(@"C:\Users\jayant\Desktop\Template.docx", false);
foreach (Control ctrl in InputWordDocument.MainDocumentPart.Document.Body.Descendants<Control>())
{
Console.WriteLine(ctrl.Name.Value);
}
But it shows the name of the controls not their values.
How do I get thevalues?