View Single Post
  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Lukeee Lukeee is offline
external usenet poster
 
Posts: 2
Default Printing certain pages in all sections

Thanks Graham,

I applied that code with a few minor changes and also did the same thing in
C# using the interop libraries, unfortunately both had the same result -
although it did print what I needed, I ended up with hundreds of jobs being
spooled!

It's just a shame that the p*s* syntax in the print dialog doesn't support
this, but thanks for your help.

"Graham Mayor" wrote:

In theory at least, the following macro should print page 1 & 2 of each
section on one printer and page 3 on another (change Printer 1 and Printer 2
for the actual printers.)

Whether this would be any quicker I hesitate to guess - try it with a few
records.

Sub PrintXSections()
Dim sCurrentPrinter As String
Dim x as Long, lSecs As Long
Dim sPages As String
lSecs = ActiveDocument.Sections.Count

sCurrentPrinter = ActivePrinter
For x = 1 To lSecs
ActivePrinter = "Printer 1"
ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, _
Pages:="p1s" & x & ",p2s" & x
ActivePrinter = "Printer 2"
ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, _
Pages:="p3s" & x
Next x
ActivePrinter = sCurrentPrinter
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org