This project has moved and is read-only. For the latest updates, please go here.

Simple Example for editing Word

Jan 3, 2015 at 11:00 AM

I'm new to NetOffice, and I wish to know if is possible to simply open an exisiting Word.doc document, find some specific text within MS Word "TextFormFields", and just replace their content, and save the document?

I couldn't see any in the tutorials, etc...

Thanks for your help and time.


Jan 3, 2015 at 12:39 PM
You find a lot of examples in the word example folder and online:

this topic shows you more about replace form fields:
(dont worry about ms-interop, the syntax in NetOffice is always pretty the same)

Jan 4, 2015 at 12:59 PM
Hi Sebastian,

Thank you so much for your help.

The library is excellent. Keep up the good work!!



Sent from Windows Mail

Feb 15, 2015 at 10:52 AM
Hi Sebastian,

While the method that you explain on those samples does provide the means to find the field and replace it for a text.

See my code below:

switch (field.Name)


case "ProjectName01":

field.Range.Text = NewValue[0];


This approach replaces the entire field all together for the text. I wish to simply find the field, and replace the content only.

Like the following sample:

Word field.Name = Client01
Word field.Text = Client Name

After the code runs, should be:

Word field.Name = Client01
Word field.Text = John Matthews

I cannot seem to find the property or attribute of the field, to do the above.

Any ideas?