FormFields Collection

J

Jack

Hello,

I have a set of Word documents that all originate from the same template
file. I am developing a VB.NET utility to import the data from each document
into an Access database. Each document will represent a single record in a
table.

All of the data I need to import are in formfields as either textboxes or
checkboxes. My plan is to iterate through the formfields collection and
append the data to the database record.

My question is this ... because not all the formfields are bookmarks, and
therefore not all have names, can I be certain that the formfields in the
formfields collection will always be returned in the same order every time I
request the collection from Word?

The assumption can be made that the structure of the documents are all
exactly the same and the only changes made were the data in the form fields.

Thanks in advance for your help!
Jack
 
W

Word Heretic

G'day "Jack" <[email protected]>,

Formfields(10) will always be the tenth formfield sequentially placed
in the document.

Of course, ideally, you should provide each formfield with its
BookMark name.


Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Jack reckoned:
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?SmFjaw==?=,
My question is this ... because not all the formfields are bookmarks, and
therefore not all have names, can I be certain that the formfields in the
formfields collection will always be returned in the same order every time I
request the collection from Word?
As long as no one changes anything yes, this should be the case.

But if you have that level of control, then you should be able to ensure all
the form fields have names before distributing the template?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
J

Jack

Thanks for confirming what I suspected to be true. Unfortunately, my project
is working with 1500 documents that have already beem completed by users and
at this point I have no control over the naming of the form fields. Most have
names but some don't and I wanted to make sure that those with no names would
not show up randomly throughout the collection with each query to the
collection.

Thanks a bunch! I really appreciate it!

Jack
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top