How do I add a new Fill-in Form Code to an existing Word Document?

I have an existing Word Document that that gets input from a VB.NET Form, using the
"Microsoft.office.interop.Word.FormFields" collection.  The application works great for the
current 17 fill-in's, but for two days I've tried to add one additional fill-in without much
success.

I've search the internet for the definitive steps to add a Word Form Field, but found steps
that were either incomplete, or did not work for an existing Word Doc.

I currently have Microsoft's Word 2010.  The VB.NET application was previous built opening Word docs
with a previous version of Microsoft's Word(maybe 2008).
N2435ProgrammerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GrahamSkanRetiredCommented:
I think that we need a lot more information.
For a start, can we see the document and the code that you are trying to use, please?
N2435ProgrammerAuthor Commented:
Thanks for the quick response.

The Word document file attached has been modified to removed all but the Form Fields.  All Fields work with my
application, except for the one named "DBName", which is the one I added using Word 2010.
Modified.docx
GrahamSkanRetiredCommented:
Your document has eleven text Form Fields and three instances of the same Merge field embedded in an If field. These two field types are generally incompatible, since Form Fields are designed to work when the document is  protected for forms and Mail Merge expects it to be unprotected. However the programmer may have found a way to use both.

There should  be no difficulty in adding a Form Field.

Make sure that the document is not protected, and select the position for the new field. On the Developer tab, find the Controls group. There is a dropdown in the lower row to the left of the central vertical bar. Click that and choose one of the three left hand controls in the Legacy Forms row,

If you have added another text form field, you can set the default text by right-clicking on the control and choosing Properties. There is a 'Default text:' box on the dialogue that opens.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
N2435ProgrammerAuthor Commented:
Thanks
Albi-LotCommented:
My approach to these kind of problems is a bit different. I would create a .NET application (C# or VB.NET) where I would put the form with data fields which will provide the data for Word document. Word document is some kind of template, which can be prepared in advance and filled at runtime.

I would avoid using Office Interop (COM libraries), because they don’t behave well in server scenarios. There are many 3rd party tools out there that use OpenXML for document generation. I have Docentric Toolkit so I use that one.

By separating creation of template documents and code for data retrival/provisioning you avoid many maintenance headaches and your end users will like it too, because even they can create or change template documens in MS Word as long as data structures are the same.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Word

From novice to tech pro — start learning today.