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.

Template will not print second page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Cameron - 29 Mar 2007 20:28 GMT
I have a template file that has a button on the form that prints out attached
files but in some instances will not print out the second page of the primary
document. How do you program the print button to print the first and second
page of the template and then the attachement pages also?
Doug Robbins - Word MVP - 30 Mar 2007 19:52 GMT
Show us the code that you presently have behind the button.

Signature

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

>I have a template file that has a button on the form that prints out
>attached
[quoted text clipped - 3 lines]
> second
> page of the template and then the attachement pages also?
Cameron - 30 Mar 2007 21:00 GMT
Private Sub CommandButton1_Click()
  Application.PrintOut FileName:="", _
   Range:=wdPrintCurrentPage, _
   Item:=wdPrintDocumentContent, _
   Copies:=1, _
   Pages:="", _
   PageType:=wdPrintAllPages, _
   ManualDuplexPrint:=False, _
   Collate:=True, _
   Background:=True, _
   PrintToFile:=False, _
   PrintZoomColumn:=0, _
   PrintZoomRow:=0, _
   PrintZoomPaperWidth:=0, _
   PrintZoomPaperHeight:=0
   
   Application.PrintOut FileName:="", _
       Range:=wdPrintRangeOfPages, _
       Item:=wdPrintDocumentContent, _
       Copies:=1, _
       Pages:="2-3", _
       PageType:=wdPrintAllPages, _
       ManualDuplexPrint:=False, _
       Collate:=True, _
       Background:=True, _
       PrintToFile:=False, _
       PrintZoomColumn:=0, _
       PrintZoomRow:=0, _
       PrintZoomPaperWidth:=0, _
       PrintZoomPaperHeight:=0

This is what I have, but when the first page prints out it is often more
then 1 page in lenght, is there a way to set the macro up to print out one
page if it has one page and two or more if it has more?

I'm not all that familur with scripting inside word.

> Show us the code that you presently have behind the button.
>
[quoted text clipped - 5 lines]
> > second
> > page of the template and then the attachement pages also?
Doug Robbins - Word MVP - 31 Mar 2007 06:58 GMT
I am not sure why you have two

Application.PrintOut

routines, but your problem is almost certainly cause by the following in the
first one

Range:=wdPrintCurrentPage, _

as it will cause only the current page to be printed.  That is one page
only.

As you are not setting any of the other parameters of the PrintOut command,
all that you probably should be using is:

ActiveDocument.PrintOut

Signature

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

> Private Sub CommandButton1_Click()
>   Application.PrintOut FileName:="", _
[quoted text clipped - 42 lines]
>> > second
>> > page of the template and then the attachement pages also?
Cameron - 23 Apr 2007 22:50 GMT
Well, what happens with this document is there are a number of paged in it.
The button is placed in the header of each document and if the user wants ot
print out that particular page then certain attached pages also print out
(hense the extra printout statement). But there is one instance in the list
of pages where the context stems over to a second page. For the most part the
current page method works fine but just this one instance. Is there a way to
have the Button click event be able to check to see if there are two or more
pages? Could I out some sort of reference in the document that could trigger
that there where more then two pages and then have to printout method change
to accomidate more then one page? I ask because there is a template file that
could very well have the same problem.

> I am not sure why you have two
>
[quoted text clipped - 59 lines]
> >> > second
> >> > page of the template and then the attachement pages also?
 
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.