Yes it was helpful. Just one more serious question.
"they write a completely different letter to the same client. Currently, they are retyping all that data "
What is different? OK, I can make some guesses. Certain text may be different, but the basic info (Name, Address etc) is the same. Correct?
OK. Again....you have to spec this stuff out.
Is essentially Letter1 the same for everyone? Is it a boilerplate letter, and they just are entering name, address etc.
Can Letter2 and Letter3 be structured with formfields?
Will they be writing these 2nd and 3rd letters right away?
Forgetting about finding Letter1 for the moment, let's say they have Letter1 open.
1. Have formfields for the chunks they are entering (Name, Address etc. Please explicitly name them. Do not accept the default names Word uses. Make the formfield name something like "Name", and "Address".
2. user enters the information, and let's say they also type in blah blah blah.
3. The code below fires as an OnExit macro in the last formfield in Letter1. In any case, Letter2 opens and IT has formfields also named "Name", "Address". If you have declared the documents as object, you can retrieve the information easily between them. The following would be code in Letter1.... something like:
Code:
Sub FillLetter2()
Dim Letter1 As Document
Dim Letter2 As Document
Dim myFieldResults() As String
Dim myFieldNames() As String
Dim var, var2
Dim i As Integer
Set Letter1 = ActiveDocument
' in Letter1 build array of both formfield results
' AND names. Have to Redim array as do not know
' how many formfields there are. NOTE that the
' array is 0 based, but formfield index is 1 based
' so need to add 1 to the variable i for formfields
For var = 1 To Letter1.FormFields.Count
ReDim Preserve myFieldResults(i)
myFieldResults(i) = Letter1.FormFields(i + 1).Result
ReDim Preserve myFieldNames(i)
myFieldNames(i) = Letter1.FormFields(i + 1).Name
i = i + 1
Next
i = 0
' open Letter2 - assume in same folder
' as Letter1
Documents.Open FileName:="Letter2.doc"
Set Letter2 = ActiveDocument
' using array of names, match formfield
' names in Letter2 to array of results in Letter1
For var2 = 0 To UBound(myFieldResults())
Letter2.FormFields(myFieldNames(i)).Result = myFieldResults(i)
i = i + 1
Next
Set Letter2 = Nothing
Set Letter1 = Nothing
End Sub
This is VERY simple stuff here. There are a LOT of things that could go wrong, depending on your design.
Again, you have to spec it out. I suggest you try it out. Make two files. Put in two formfields and rename them Name and Address.
Copy the above and put it in a code module. In the Properties of the Address formfield, make the Sub the OnExit macro. Protect the document for forms. Save the file as Letter1.doc. Then do a SaveAs and save it as Letter2.doc. Exit Letter2. Reopen Letter1 and type in whatever to the Name field and Address field and press Tab (which moves between formfield.
Letter2 will be opened and the fields automatically filled in with the results from Letter1.
I must repeat that this is pretty straightforward, and you HAVE TO be clear about what you are doing with the design of the letters. I do not know what else you need to be able to enter into them.
Gerry