
Signature
Charles Kenyon
Word New User FAQ & Web Directory: http://addbalance.com/word
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
To get information directly from formf fields, use the .Result property of
each form field.
ActiveDocument.FormFields("name").Result
You could build an array of all form fields:
Dim FFArray() As String
Dim mFormField As FormField
Dim i As Integer
On Error Resume Next
For Each mFormField in ActiveDocument.FormFields
Redim Preserve FFArray(i)
FFArray(i) = mFormField.Result
i = i + 1
Next
Now you have an array of all form field results. NOTE! you must do some
error trapping on this. Do a check on the form field type. The above
assumes all TEXT formf fields.
You can test form field types with the following constants.
text formfield Type = 70
checkbox form field Type = 71
dropdown form field Type = 83
Once you have the array of results, you can do what you like with the
information, including exporting the data to Access.
> Tools > Options > Save > Save data only for forms?
>
> > Anyone know how to extract the data from form fields
> > when the doc closes so that it can be saved in an access
> > database?
DGjr. - 01 Jun 2005 00:12 GMT
fumei -
Once the results are obtained via "ActiveDocument.FormFields("name").Result
", how do you then push this data into an access database? I have no VBA
experience but would be willing to try to muddle through it.
DGjr.
> To get information directly from formf fields, use the .Result property of
> each form field.
[quoted text clipped - 32 lines]
> > > when the doc closes so that it can be saved in an access
> > > database?
David Sisson - 01 Jun 2005 04:30 GMT
You can find alot of info on getting data from Access, but not much the
other way. However, I did find this using Google and searching within
this newsgroup.
http://groups-beta.google.com/group/microsoft.public.word.vba.general/browse_thr
ead/thread/67566ed5f93f0a81/5107e60174c7cf32?q=word+to+access&rnum=26&hl=en#5107
e60174c7cf32
If link doesn't work, search for Export Word Formfields to Access.