Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2007

Tip: Looking for answers? Try searching our database.

VBA - Print Current Page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JayM - 18 Apr 2007 14:06 GMT
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
Ed - 19 Apr 2007 19:10 GMT
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

> 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
[quoted text clipped - 19 lines]
>
> JayM
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.