VBA - Print Current Page

J

JayM

I have a macro that prints the current page from a button on the toolbar.
This is used by word 2000 and word 2003 users unfortunately it seems that for
the word 2003 users the print current page prints the page previous unless
their cursor is at the very bottom of the page.

Any ideas?

Code follows:

Sub PRINT_THIN_CURPAGE()
' PRINT_THIN_CURPAGE Macro
'UNPROTECTDOCUMENT
With ActiveDocument.PageSetup
.FirstPageTray = wdPrinterPaperCassette
.OtherPagesTray = wdPrinterPaperCassette
End With
Application.PrintOut filename:="", Range:=wdPrintCurrentPage,
Item:=wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, Collate:=True, Background:=True, PrintToFile:=False
'REPROTECTDOCUMENT
End Sub

JayM
 
E

Ed

Hi JayM,

I don't know what causes this behaviour but a possible work-around if
required seems to be to replace

Range:=wdPrintCurrentPage

in the PrintOut command with

Range:=wdPrintRangeOfPages
Pages:=CStr(Selection.Information(wdActiveEndPageNumber)).

It seems to have worked for Tabasco Ed (no relation) from one of whose
replies I snaffled it a while ago, and (so far) it works for me.


Cheers.


Ed
 

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