> I have this printer that staples every print job.
> I have this mail merge document where every three pages is directed to a new
[quoted text clipped - 4 lines]
> Konica has no solution for it. And I wanted to know if MS Word via VBA or
> anything can send every three pages of its document as a separate print job.
This is doing the trick, However I'm testing it with only 9 pages of the
merge document and it is printing out 7 pages (1,2,3,4,5,6,7 ) stapled then
it prints and staples pages (7,8,9)
So it only works for the last set of 3 pages.
Could you possible comment the script as I am very new to VB. And it seems
it could be a function/math issue.
Thank you very much Peter, you are a saver.
-K
> Something like this might help:
>
[quoted text clipped - 26 lines]
> > Konica has no solution for it. And I wanted to know if MS Word via VBA or
> > anything can send every three pages of its document as a separate print job.
Peter - 30 Nov 2004 20:46 GMT
Hmm.... I checked it out again and it doesn't look like it should be behaving as you describe.
I found one error: I was setting iPageTo = iPageFrom + 3, when it should be +2 because the page range is inclusive.
Dim iPageFrom As Integer
Dim iPageTo As Integer
Dim iPages As Integer
''' get the number of pages in the document from the document properties
iPages = ActiveDocument.BuiltInDocumentProperties("Number of pages")
''' iterate through the pages, going every three
For iPageFrom = 1 To iPages Step 3
''' set the page range to print. It's inclusive, so just add two to the current page
iPageTo = iPageFrom + 2
''' check to make sure we're not going to send an invalid page to the PrintOut command
If iPageTo > iPages Then iPageTo = iPages
''' print the range of pages. Use background printing so this doesn't take forever
Call ActiveDocument.PrintOut(Background:=True, Range:=wdPrintFromTo, From:=CStr(iPageFrom), To:=CStr(iPageTo))
Next iPageFrom
Other than that, I don't see anything here that would cause the behavior you described.
I have been known to be blind sometimes, so perhaps someone else out there can eyeball it?
-Peter
> This is doing the trick, However I'm testing it with only 9 pages of the
> merge document and it is printing out 7 pages (1,2,3,4,5,6,7 ) stapled then
[quoted text clipped - 35 lines]
> > > Konica has no solution for it. And I wanted to know if MS Word via VBA or
> > > anything can send every three pages of its document as a separate print job.