PDA

View Full Version : Solved: Print last page



bangerz
10-12-2005, 02:32 AM
Hi,

I am trying to create a macro in Word Xp to print out the last page of a document (could be page 3 or 4 or 5 depending on the contents) to a different printer to the rest of the document.

I am working along the lines of ActiveDocument.PrintOut Range:=

But I am unsure of how to specify the last page after Range:= as it varies on each printout.

Any help will be greatly appreciated

fumei
10-12-2005, 05:43 AM
A couple of ways.

1. Move selection to the last page, then simply make the Print instruction to print the current page.
Selection.EndKey unit:=wdStory
Application.PrintOut FileName:="", _
Range:=wdPrintCurrentPage

2. Make a Selection of the last page, then print the Selection.
Selection.EndKey unit:=wdStory
ActiveDocument.Bookmarks("\page").Range.Select
Application.PrintOut FileName:="", _
Range:=wdPrintSelection

bangerz
10-13-2005, 03:07 AM
Thanks for the help - I will try these later.

Wez

bangerz
10-13-2005, 08:44 AM
Works exactly as i wanted - many thanks again

MOS MASTER
10-13-2005, 01:37 PM
Hi Wez welcome to VBAX! :hi:

Don't forget to mark your thread solved. :whistle: