Results 1 to 2 of 2
2005-10-26, 04:40 #1
- Join Date
- Sep 2005
- Thanked 0 Times in 0 Posts
Printing ltrs w/o their envelopes (97)
We currently use word 97 to merge our batch letters out of our database & each of those batch letters contain an envelope attached to it with the address. The dilema we are having is that we don't always want to print the envelopes (IE we may be simply printing the ltter out for faxing).
Therefore my question to the group is" Is there a way using a macro; VBA; etc to say to to word don't print the envelopes on this batch only print out the letters them selves?
It seems we are wasting alot of envelopes doing it our way & simply end up trashing them. I know for myself along time ago I created a macro that I installed onto my toolbar that allows me to ONLY print the current page, this is what that VBA looks like:
' PrintCurrentPage Macro
' Macro recorded 04/20/04 by Bradley Lansinger, CPCS
Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
Collate:=True, Background:=True, PrintToFile:=False
I would use something like this (and put a macro button onto everyones machine) but dont want the person to have to click on each indivisdual letter letter to tell word to just print this document & NOT the envelope.
If anyone has any ideas or VBA code they would be willing to share you wpuuld make my life & my staff's life much happier. Also I wasn't sure if this question should be posted under the VBA forum which I will also do.
PS I have attached one of the letters showing how the letters wouldlook, however imgine that there are about 4 of these records it prints all 5 pages for.
2005-10-26, 06:09 #2
- Join Date
- Feb 2001
- Silicon Valley, USA
- Thanked 93 Times in 89 Posts
Re: Printing ltrs w/o their envelopes (97)
It appears that the envelopes are always in an odd-numbered section and the letters are always in an even numbered section. So you could write a macro to print just the even numbered sections. Perhaps like this:
Dim intCount As Integer, strPrintRange As String
For intCount = 2 To ActiveDocument.Sections.Count Step 2
strPrintRange = strPrintRange & "s" & CStr(intCount) & ", "
Application.PrintOut Range:=wdPrintRangeOfPages, _
Item:=wdPrintDocumentContent, Copies:=1, _
Pages:=Left(strPrintRange, Len(strPrintRange) - 2), _
PageType:=wdPrintAllPages, Collate:=True, _
For testing purposes, I suggest a print-to-PDF driver. <img src=/S/wink.gif border=0 alt=wink width=15 height=15> Does it do the job?