Accessing form.fields in MS Word
Posted on 2003-03-12
This is my first c# program so i think my question is very basic. I wrote the folloing program to open a word document and cycle through each field in the form...
private void button1_Click(object sender, System.EventArgs e)
if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
object fileName = openFileDialog1.FileName;
object readOnly = false;
object isVisible = true;
object missing = System.Reflection.Missing.Value;
WordApp.Visible = false;
Word.Document aDoc = WordApp.Documents.Open(ref fileName, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible);
for(int i=0; i<aDoc.FormFields.Count; i++)
I dont know how to cycle through the different fields in the for loop. What should i put in this loop...or am i on the wrong track?