Printing selected pages

D

Dudley

In a macro I have code to print to file:

Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, Collate:=True, Background:=True,
PrintToFile:= _
True, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0, OutputFileName:=sTmp, Append:=False

How do I change this to print starting from page 2?

Thanks for any help.
Dudley
 
P

Pesach Shelnitz

Hi Dudley,

You need to set the Range parameter equal to wdPrintFromTo and set the From
parameter to "2". In addition, all the numbers need to be enclosed in
quotation marks, as in the following.

Application.PrintOut fileName:="", Range:=wdPrintFromTo, _
From:="2", Item:=wdPrintDocumentContent, _
Copies:="1", PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, Collate:=True, Background:=True, _
PrintToFile:=True, _
PrintZoomColumn:="0", PrintZoomRow:="0", PrintZoomPaperWidth:="0", _
PrintZoomPaperHeight:="0", OutputFileName:=sTmp, Append:=False
 
D

Doug Robbins - Word MVP

Replace

Range:=wdPrintAllDocument

with

Range:=wdPrintFromTo, From:="2", To:="n"

If you don't know what n is, just make it a number bigger than the likely
total number of pages in the document.

--
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, originally posted via msnews.microsoft.com
 
D

Dudley

Thanks very much for your help.

Dudley

Doug Robbins - Word MVP said:
Replace

Range:=wdPrintAllDocument

with

Range:=wdPrintFromTo, From:="2", To:="n"

If you don't know what n is, just make it a number bigger than the likely
total number of pages in the document.

--
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, originally posted via msnews.microsoft.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top