Reply
 
Thread Tools Display Modes
  #1   Report Post  
craig friend via OfficeKB.com
 
Posts: n/a
Default Mailmerge printing different paper tray multiple sections per print job

Doug was VERY helpful and provided me with a macro that would run from the
merged document and print each record as a separate job. The problem I ran
into was that the template itself actually contains 3 sections per record. So
the macro;

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


Functions properly however, I beleive it's treating each section as a
separate print job. I need to somehow get it to print after every 3rd
section or determine another way of splitting up the jobs.

Any help would be greatly appreciated!

--
Message posted via http://www.officekb.com
  #2   Report Post  
Peter Jamieson
 
Posts: n/a
Default

As an interim suggestion, how about adjusting the range of sections, e.g.


Dim i As Long
For i = 1 To ActiveDocument.Sections.Count Step 3
ActiveDocument.PrintOut Range:=wdPrintFromTo, From:="s" & i, To:="s" &
trim(cstr(i+2))
Next i

Peter Jamieson
"craig friend via OfficeKB.com" wrote in message
...
Doug was VERY helpful and provided me with a macro that would run from the
merged document and print each record as a separate job. The problem I
ran
into was that the template itself actually contains 3 sections per record.
So
the macro;

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


Functions properly however, I beleive it's treating each section as a
separate print job. I need to somehow get it to print after every 3rd
section or determine another way of splitting up the jobs.

Any help would be greatly appreciated!

--
Message posted via http://www.officekb.com



  #3   Report Post  
craig friend via OfficeKB.com
 
Posts: n/a
Default

Thanks for the suggestion...I'll have to try that one.
I actually added two other variables

Dim i As Long
Dim k As Long
Dim j As Long

k=1
j=3

For i = 1 To ActiveDocument.Sections.Count
ActiveDocument.PrintOut Range:=wdPrintFromTo, From:="s" & k, To:="s" & j
k=k+3
j=j+3

Next i

--
Message posted via http://www.officekb.com
  #4   Report Post  
craig friend via OfficeKB.com
 
Posts: n/a
Default

Correction:

Dim i As Long
Dim k As Long
Dim j As Long

k=1
j=3

For i = 1 To ActiveDocument.Sections.Count/3
ActiveDocument.PrintOut Range:=wdPrintFromTo, From:="s" & k, To:="s" & j
k=k+3
j=j+3

Next i

--
Message posted via http://www.officekb.com
  #5   Report Post  
Peter Jamieson
 
Posts: n/a
Default

If it works, it works. but just out of interest, why not use the "Step"
keyword in the For statement? as I suggested? It just seems a bit more
straightforward to me.

Peter Jamieson
"craig friend via OfficeKB.com" wrote in message
...
Correction:

Dim i As Long
Dim k As Long
Dim j As Long

k=1
j=3

For i = 1 To ActiveDocument.Sections.Count/3
ActiveDocument.PrintOut Range:=wdPrintFromTo, From:="s" & k, To:="s" & j
k=k+3
j=j+3

Next i

--
Message posted via http://www.officekb.com





  #6   Report Post  
craig friend via OfficeKB.com
 
Posts: n/a
Default

Peter...thanks again!

It did work...but the your's is much cleaner. I just wasn't aware of Step
keyword.

Thanks again for all your help!

--
Message posted via http://www.officekb.com
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I change paper tray options on the fly--without making it . monsieurms Microsoft Word Help 3 March 8th 05 06:31 PM
Printing multiple pages on a sheet of paper Bill Seymour Page Layout 7 February 22nd 05 07:07 AM
help on ms word printing paper resize (destination paper) Ahsan New Users 1 February 12th 05 09:07 PM
Multiple copies & Landscape problems when printing in Word Matrix Microsoft Word Help 1 February 3rd 05 09:44 AM
Printing multiple pages in 1 problem Anthony Microsoft Word Help 1 January 10th 05 11:18 AM


All times are GMT +1. The time now is 07:01 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"