Printing Envelope with currently selected text as address

P

Pat B.

Word 2003
We use a custom database for our travel-related business. The database
creates a merge document for our confirmation letter. I print 10-20 of these
a day. I have one printer with normal paper, and one printer with envelopes.
Currently, open the print dialog, change the printer to the envelope
printer, then highlight the person's address, go to Tools\Envelopes and
Labels (Alt+L) and click print to print the envelope.

I have created a macro to change the printer for me, but I need two. One to
change to the envelope printer, and one to change back to default printer.
What I would like, it to have a macro change the printer, print the envelope,
and then change the printer back. I tried recording the macro, but it saved
the name/address and does not update it when I try to print the letter for
antoher customer.

How do I get the Envelopes and Labels dialog to populate with the currently
selected text and not the text I had selected when I created the macro?

Thanks
Pat
 
G

Graham Mayor

The second question is also covered in the linked page ;)

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
P

Pat B.

Graham Mayor said:
The second question is also covered in the linked page ;)


Thanks for the link, but it didn't help. I was able to get macros to switch
the printer. The macro they had for the envelopes and lables opened the
dialog fine, but did not copy in the selected text.

I started from scratch and recorded a macro. The big problem was it
included an Address="Bob Smith" if Bob Smith was the person selected when
creating the macro. I deleted the Address="Bob Smith" line and the macro now
does what I want.

Sub PrintAddressOnEnvelope()
'
Selection.copy
ActivePrinter = "Envelope Printer"
ActiveDocument.Envelope.PrintOut ExtractAddress:=False,
OmitReturnAddress _
:=True, PrintBarCode:=False, PrintFIMA:=False,
Height:=InchesToPoints( _
4.13), Width:=InchesToPoints(9.5), AutoText _
:="ToolsCreateLabels1", ReturnAddress:="Our Compay Name", _
ReturnAutoText:="ToolsCreateLabels2",
AddressFromLeft:=wdAutoPosition, _
AddressFromTop:=wdAutoPosition,
ReturnAddressFromLeft:=wdAutoPosition, _
ReturnAddressFromTop:=wdAutoPosition,
DefaultOrientation:=wdLeftClockwise _
, DefaultFaceUp:=False
ActivePrinter = "HP DeskJet Draft"
End Sub
 

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