A simple experiment here suggests that
Sub ListFormFields()
Dim oFormField As Word.FormField
For Each oFormField In ActiveDocument.FormFields
Debug.Print oFormField.Type, oFormField.Result
Next
End Sub
lists all the types and results, even when the field names are blank. This
is in Word 2000. So...
a. Are you using similar code?
b. which version of Word?
An alternative might be to programmatically set Tools|Options|Save|"Save
data only for forms" then save the form, then open the resulting .csv file
using VBA OPEN (or otherwise), read the data and save it in your database.
--
Peter Jamieson - Word MVP
Word MVP web site http://word.mvps.org/
> I have received a number of documents, which have fields embedded in the
> form, and then protected.
[quoted text clipped - 6 lines]
>
> Thanks if you can help.
wphx - 19 Feb 2004 14:01 GMT
I think I've found my way through this.
Using access, I had first tried using the formfield names to create the
access table fields - however, there were duplicates and errors.
second, I created a tranlastion table - one field containing the word field
name and the second containing a unique access field name (generated from
the word field name)
I then walked through the formfields() collection, and sequentially grabbed
the access field name from the translation table.
I was able then to create the table and write the data into the appropriate
fields.
I had tried renaming the field names in the source document programattically
but it got into a tangle with the duplicate field names.
Anyhow, your reply has borne up what I found out that if I just scan thru
the collection, I can bypass referencing the field by its name.
Thanks again
> A simple experiment here suggests that
>
[quoted text clipped - 29 lines]
> >
> > Thanks if you can help.