Print Macro

J

John Calder

Hi

I presently have a macro attached to a small graphic that
when selected prints the current page (see code below).
This works fine but what I would like to add to it is have
it so when the graphic is selected, not only does it print
the current page but also prints the following page.

My document has a number of 2 page forms so to simplifiy
the printing is the reason that I want to include this.

Any help would be much appreciated

John


Sub PrintCurrentPage()
'
' PrintCurrentPage Macro

Application.PrintOut FileName:="",
Range:=wdPrintCurrentPage, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=False, Background:=False,
PrintToFile:=False, PrintZoomColumn:=0 _
, PrintZoomRow:=0, PrintZoomPaperWidth:=0,
PrintZoomPaperHeight:=0
End Sub
 
D

Doug Robbins - Word MVP

Hi John,

The following code will do what you want:

Dim currpage As Integer, currsection As Integer
currpage = Selection.Information(wdActiveEndPageNumber)
currsection = Selection.Information(wdActiveEndSectionNumber)
ActiveDocument.PrintOut Range:=wdPrintFromTo, From:="p" & currpage & "s" &
currsecction, To:="p" & currpage + 1 & "s" & currsecction

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
J

John Calder

Doug, many thanks for your prompt response

Do I replace my code with this code or do I add it to it?

Thanks

John
 
J

John Calder

Worked it out and it works great !!!

Whatever they are paying you Doug it aint enough !!!

Thanks again!
 

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