Open XML SDK 2.0を使用して C# でコードを書いています。TextBox、Select Option などのWord 文書でいくつかのコントロールを定義しました。それらのデータをプログラムで読み取りたいです (以下にサンプルを示します)。
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);
}
ただし、値ではなくコントロールの名前が表示されます。
値を取得するにはどうすればよいですか?