moving text from a Word form into a Word template

C

cliffordjf

We use a MS Word form to collect information from our internal customers.
They complete the form then email it to us. We use that data to create
contract documents by cutting and pasting (or worse, re-typing) the
information into various contract templates. There are about 20 data boxes
on the form, and most are required information for to have to complete the
contracts. We have a number of contract templates and select the
appropriate one based on the situation.

It seems like there should be an easier way of moving data from one document
to another. Is there an analogous way to mail merge to pull data from the
completed form into a selected template?

Any ideas or suggestions appreciated.

Cliffordjf
 
D

Doug Robbins - Word MVP on news.microsoft.com

How proficient are you at VBA coding?

It is not too difficult to set up the templates with DOCVARIABLE fields at
the locations where you want the information to appear and then have an
autonew macro in the template that opens a dialog box which will allow you
to select the form provided by your internal cusotmer and then parse that
form for the relevant data with which it would create variables in the
document created from the template and then update the fields in the
document so that the data appears in the DOCVARIABLE fields.

Assuming that you use the same name for the document variables as the
bookmark names assigned to each of the FormFields in the internal customer
form, the code (untested) for the autonew macro would be:

Dim fd As FileDialog
Dim Source As Document
Dim Target As Document
Dim i As Long
Set Target = ActiveDocument
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
.AllowMultiSelect = False
.Title = "Select Form Document that you want to use"
.InitialFileName = ""
If .Show = -1 Then
Set Source = Documents.Open(.SelectedItems(1))
Else
MsgBox "You must select a Form Document."
Exit Sub
End If
End With
Set fd = Nothing
With Source
For i = 1 To .FormFields.Count
Target.Variables(.FormFields(1).Name).Value = .FormFields(1).result
Next i
End With
Target.Range.Fields.Update

If that is beyond you and you would like to engage me to develop the
application for you, email me at (e-mail address removed)

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

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