PDA

View Full Version : Solved: Print Envelopes



JohnnyBravo
01-19-2006, 09:27 AM
I recorded the following macro in Word but the problem is that sometimes it prints fine and sometimes it prints blank. Apparently, it's not grabbing the send to address.

Sub PrintEnvelope()
'
' PrintEnvelope Macro
' Macro recorded 11/2/2005 by John
'
ActiveDocument.Envelope.PrintOut ExtractAddress:=True, OmitReturnAddress _
:=False, PrintBarCode:=False, PrintFIMA:=False, Height:=InchesToPoints( _
4.13), Width:=InchesToPoints(9.5), AddressFromLeft:=InchesToPoints(3.5), _
AddressFromTop:=InchesToPoints(2), ReturnAddressFromLeft:=wdAutoPosition, _
ReturnAddressFromTop:=wdAutoPosition, DefaultOrientation:= _
wdCenterLandscape, DefaultFaceUp:=True, PrintEPostage:=False
End Sub

fumei
01-19-2006, 09:37 AM
Apparently, it's not grabbing the send to address.Huh???? WHAT send to address?

JohnnyBravo
01-19-2006, 10:39 AM
Sorry, should have been more specific.

Basically, I recorded the macro because I sent out a lot of letters and I don't like the way Word prints the envelope. I like to have it more "centered" nice & neatly on the envelope and so I recorded the macro above.

For some letters, I notice that no matter where the cursor is, it knows where to look for (addressee) and prints the envelope properly. But somemtimes, it prints out a blank.

fumei
01-19-2006, 11:23 AM
So I will do another "Huh"?
it knows where to look for (addressee)

JohnnyBravo
01-19-2006, 11:48 AM
Gerry - this is a standard business letter we're talking about - nothing fancy. By "standard" I mean to say that it follows the traditional format.

<Date>



Mrs. Jane Doe
President
ABC Corporation
123 Main Street
Chicago, IL 60601

Mrs. Doe:

<Body of letter>

================================

So back to my question: How do I modify the vba code so that the envelope prints out properly instead of blanks?

lucas
01-19-2006, 12:26 PM
Hi Johnny,
I use this for envelopes...
the attached file will help you print your envelope but you will need to add the formatting that you desire......let me know if this helps and maybe Gerry or another real Word VBA expert can help you with the formatting....

JohnnyBravo
01-23-2006, 10:01 AM
Thank you Lucas.