Consulting

Results 1 to 7 of 7

Thread: Solved: Print Envelopes

  1. #1

    Solved: Print Envelopes

    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.

    [VBA]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[/VBA]

  2. #2
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    Apparently, it's not grabbing the send to address.
    Huh???? WHAT send to address?

  3. #3
    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.

  4. #4
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    So I will do another "Huh"?
    it knows where to look for (addressee)

  5. #5
    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?

  6. #6
    VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    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....
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  7. #7
    Thank you Lucas.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •