Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-27-2012, 07:52 AM
nkg nkg is offline Print document except first page Windows 7 64bit Print document except first page Office 2003
Novice
Print document except first page
 
Join Date: Feb 2012
Posts: 4
nkg is on a distinguished road
Default Print document except first page

Hi All,

I have some documents which I want to print in following rules:

1. Print whole document except first page.



2. If there is only a single page in a document then execute another code which I have to use it.

Thanks in advance.
NG
Reply With Quote
  #2  
Old 05-02-2012, 12:22 AM
macropod's Avatar
macropod macropod is offline Print document except first page Windows 7 64bit Print document except first page Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi NG,

Try:
Code:
Sub PrintPages2Plus()
With ActiveDocument
  If .ComputeStatistics(wdStatisticPages) > 1 Then
    .PrintOut Background:=True, Range:=wdPrintRangeOfPages, Pages:="2-" & .ComputeStatistics(wdStatisticPages)
  Else
    'your other routine goes here
  End If
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 05-02-2012, 12:27 PM
nkg nkg is offline Print document except first page Windows 7 64bit Print document except first page Office 2003
Novice
Print document except first page
 
Join Date: Feb 2012
Posts: 4
nkg is on a distinguished road
Default

Hi Macropod,

Thanks for the code. Works fine when there is no page number is given in the document.

But when I have execute this on a file which have different page nos. the printer status
box shows N/A in "pages" column and doesnt print anything.

I forgot in my previous mail that there are different page numbers in each file.

Thanks & Regards,
NG
Reply With Quote
  #4  
Old 05-02-2012, 04:16 PM
macropod's Avatar
macropod macropod is offline Print document except first page Windows 7 64bit Print document except first page Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

If you have different page numbering sequences in the document, what is the logic that determines the range to print? For example, do you want to print all except the first page of the entire document, or all except the first page of each numbered range?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 05-05-2012, 02:52 AM
nkg nkg is offline Print document except first page Windows 7 64bit Print document except first page Office 2003
Novice
Print document except first page
 
Join Date: Feb 2012
Posts: 4
nkg is on a distinguished road
Default

Hi Macropod,

There is a first blank page in some document and in other docs some text which is not to print (you say it separator page)...

So I want only to print whole file except first pages in every file.

Once again thank you very much.

Warm Regards

NG
Reply With Quote
  #6  
Old 05-05-2012, 03:57 AM
macropod's Avatar
macropod macropod is offline Print document except first page Windows 7 64bit Print document except first page Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi NG,

You still haven't answered my question. Whether your first page is blank makes no difference to the macro - it doesn't care what's on the first page. It simply starts printing at page 2.

Here is a different version that you can try. It should work with any document structure:
Code:
Sub PrintPages2Plus()
With ActiveDocument
  If .ComputeStatistics(wdStatisticPages) > 1 Then
    If .Sections(1).Range.ComputeStatistics(wdStatisticPages) > 1 Then
      .PrintOut Background:=True, Range:=wdPrintFromTo, From:="p2s1", _
        To:="p" & .Sections(.Sections.Count).Range.ComputeStatistics(wdStatisticPages) & "s" & .Sections.Count
    Else
      .PrintOut Background:=True, Range:=wdPrintFromTo, From:="p1s2", _
        To:="p" & .Sections(.Sections.Count).Range.ComputeStatistics(wdStatisticPages) & "s" & .Sections.Count
    End If
  Else
    'your other routine goes here
  End If
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Print document except first page How to print on both sides of a page manually Guy Roth PowerPoint 5 03-22-2012 06:43 AM
Print document except first page Background Page color is not covering the entire page when I print the doc prateekb Word 4 03-14-2012 01:19 AM
Print document except first page Dont print header on first page jezh Word 1 02-01-2012 09:37 AM
Not able to print in a page cookiegal Outlook 0 06-02-2011 01:02 AM
Print page one garon5 Outlook 0 03-07-2007 02:47 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:13 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft