Saving Form Fields?

W

Will Goldring

Anyone know how to extract the data from form fields
when the doc closes so that it can be saved in an access
database?
 
F

fumei

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.
 
D

DGjr.

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.
 

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