I use the Microsoft.Office.Interop.Word namespace in a console application to retrieve form data from an MSWord document. This MSWord document has fields, each of which is assigned a bookmark, which I use as an identifier.
I would like to get the value of the field from its tab and save it in the dictionary. I can get only the value of each field, but not the tab AND field.
Is there a way that I could do something like wdField.Result.Bookmark to get a field bookmark? I looked at the MSDN documentation, but it's hard for me to get it right. Here is the foreach loop that I am listing with:
foreach (Field wdField in oWordDoc.Fields) { wdField.Select(); string fieldText = wdField.Result.Text Console.WriteLine(fieldText);
source share