Envelope & Letter Forms

G

Guest

I have several frequently used documents that have an envelope and letter form.
Is there a way to have the address filled in on the envelope automatically
show up on the letter too?
Thank you for any help!!!
 
G

Graham Mayor

It is easy enough to get the content of a form field placed in another form
field or reproduced in a REF field.
Provided the REF field is not in the document header or in a text box, you
only need to check the calculate on exit check box in the form field
properties for it to update the associated REF field.

If you want the fields to be still editable in the letter, then you need to
run a macro on exit from the last form field on the envelope to update the
associated fields on the letter. You would need code something like :

Sub OnExitText3()
'fills text field based on content of _
form field "Text3"

Dim oFld As FormFields
Dim sName As String
Dim sAddr1 As String
Dim sAddr2 As String

Set oFld = ActiveDocument.FormFields

sName = oFld("Text1").Result
sAddr1 = oFld("Text2").Result
sAddr2 = oFld("Text3").Result

oFld("Text4").Result = sName
oFld("Text5").Result = sAddr1
oFld("Text6").Result = sAddr2

End Sub


which will take the contents of form fields bookmarked text1 to text3 and
place the content in form fields bookmarked text4 to text6. Change the names
and add fields to save the macro in your document template. Create new
letter from the template.

See also http://www.gmayor.com/installing_macro.htm &
http://gregmaxey.mvps.org/Repeating_Data.htm


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.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