Word 2007 and Macro; Help needed

J

jkingBoise

I have this macro that prints an address onto an envelope that I have
selected in a letter. It doesn't work because the macro is printing
only the first line of the address. In the example below, it prints
"Collection Department" instead of the entire address which is:

Collections Department
Bruneel Tire Factory
5304 Chinden Blvd
Boise, ID
83714

How can I make it work. I really need this macro.

Thanks.
John King
(e-mail address removed)

Sub Macro1()
'
' Macro1 Macro
'
ActivePrinter = "HP Officejet 7400 series"
ActiveDocument.Envelope.PrintOut ExtractAddress:=False,
OmitReturnAddress _
:=False, Height:=InchesToPoints(4.13), Width:=InchesToPoints
(9.5), _
Address:="Collections Department",
AutoText:="ToolsCreateLabels3", _
ReturnAddress:="", ReturnAutoText:="ToolsCreateLabels4",
AddressFromLeft _
:=wdAutoPosition, AddressFromTop:=wdAutoPosition,
ReturnAddressFromLeft:= _
wdAutoPosition, ReturnAddressFromTop:=wdAutoPosition,
DefaultOrientation _
:=wdCenterLandscape, DefaultFaceUp:=False,
PrintEPostage:=False
End Sub
 
P

Pesach Shelnitz

Hi John,

Your macro contains the following line.

Address:="Collections Department",

This line instructs Word to use only Collections Department. One way to use
the complete address would be to replace this line by the following.

Address:="Collections Department" & vbCr _
& "Bruneel Tire Factory" & vbCr _
& "5304 Chinden Blvd" & vbCr _
& "Boise, ID" & vbCr _
& "83714",

You say that you selected the address in your letter. Please explain what
you did at this point.
 
J

jkingBoise

Thank you for your reply! After I select the address I use the print-
onto-envelope commands from the Word 2007 ribbon. What I want to do
is create a macro that will do pick up the address as a variable in
the macro and print it. Your solution would print the same address
each time.

John King
 
G

Graham Mayor

You might find http://www.gmayor.com/EnvelopesAndLabels.htm useful. It adds
some options to the ribbon and the choice of picking the address from the
letter (with some provisos listed on the page) from Outlook or typed from
the keyboard.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



Thank you for your reply! After I select the address I use the print-
onto-envelope commands from the Word 2007 ribbon. What I want to do
is create a macro that will do pick up the address as a variable in
the macro and print it. Your solution would print the same address
each time.

John King
 

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