Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / General MS Word Questions / October 2006

Tip: Looking for answers? Try searching our database.

Mail Merge with Macro to print

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sondra - 11 Oct 2006 03:35 GMT
I have created a two page document that is used to mailmerge the address into
the file and also has some fill-in fields.  After the document is merged, I
would like to have a macro run that automatically creates and adds the
envelope to the document, change the envelope mailing address to large cap
and remove all punctuation.

After the macro completes:  
The first page would then be the envelope.  
The second page the first page of the letter.
The third page the second page of the letter.

Then I want to be able to have the first page print out of the envelope
feeder, the second out of tray 2 and the third page to print out of tray 3.

I have some very novice users with regard to printing out of multiple trays;
therefore if I can make it all automated for them it would definitely save me
lots of training and re-training time.

Anyone have any suggestions on how to write this code or even if it is
possible.

Thanks.
Doug Robbins - Word MVP - 11 Oct 2006 20:00 GMT
I would add the envelope to the mailmerge main documnet, and insert and
format the fields in it the way that you want and then execute the merge to
a new document.

Then, I would use a macro such as the following to send each letter and its
envelope to the printer:

Dim i As Long
With ActiveDocument
   For i = 1 To .Sections.Count Step 2
       .PrintOut Range:=wdPrintFromTo, From:="s" & i, To:="s" & i + 1
   Next i
End With

For the printing from different trays part, see the following series of
articles by fellow MVP Jonathon West:

Controlling the Printer from Word VBA
Part 1: Using VBA to Select the Paper Tray
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=101

Controlling the Printer from Word VBA
Part 2: Using VBA to control Duplex, Color Mode and Print Quality
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=116

Controlling the Printer from Word VBA
Part 3: Dealing with Different Paper Sizes
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=132

Controlling the Printer from Word VBA
Part 4: Getting printer driver details
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=183

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>I have created a two page document that is used to mailmerge the address
>into
[quoted text clipped - 23 lines]
>
> Thanks.
Sondra - 12 Oct 2006 00:09 GMT
This work wonderfully and I was able to create the document so that the
envelope prints from the feeder, the letterhead from tray 2 and the form from
tray 3.  Thanks so much....

I don't work much in Word for programming; therefore any advise you can
offer on forcing the envelope to Uppercase no punctuation would really help.

Thanks again.

> I would add the envelope to the mailmerge main documnet, and insert and
> format the fields in it the way that you want and then execute the merge to
[quoted text clipped - 56 lines]
> >
> > Thanks.
Doug Robbins - Word MVP - 13 Oct 2006 21:52 GMT
Where does the punctuation come from?  If it is not in the source data,
perhaps you are using the AddressBlock.  Instead of doing that, just insert
the individual merge fields in the configuration that you desire.

To get the data on the envelope to appear in upper case, use Alt+F9 to
toggle on the display of field codes in the main documnet and add the
following formatting switch inside the closing }

\* Upper

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> This work wonderfully and I was able to create the document so that the
> envelope prints from the feeder, the letterhead from tray 2 and the form
[quoted text clipped - 73 lines]
>> >
>> > Thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.