Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-05-2016, 04:43 PM
Bursal Bursal is offline Code to Print page 2 only Windows 7 64bit Code to Print page 2 only Office 2010 64bit
Novice
Code to Print page 2 only
 
Join Date: Aug 2014
Posts: 6
Bursal is on a distinguished road
Default Code to Print page 2 only

I have been asked to create a number of templates for a NfP organisation. The first page of these templates are info and instructions and I don't want it to print. Rather than getting users to use 'print current page' I would like code to print page 2 only so that when the print button is selected the code will be activated.



Thanks for reading my post and hope you can help me.
Bursal
Reply With Quote
  #2  
Old 05-05-2016, 09:58 PM
gmayor's Avatar
gmayor gmayor is offline Code to Print page 2 only Windows 10 Code to Print page 2 only Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,104
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Save the templates as macro enabled and add the following macros to the templates. the macros will intercept the Print commands and print only page 2
Code:
Option Explicit

Sub FilePrint()
    Application.PrintOut Filename:="", _
                         Range:=wdPrintRangeOfPages, _
                         copies:=1, _
                         Pages:="2"
End Sub

Sub FilePrintDefault()
    Application.PrintOut Filename:="", _
                         Range:=wdPrintRangeOfPages, _
                         copies:=1, _
                         Pages:="2"
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to Print page 2 only Field Code won't print an image John Sutton Word 4 07-28-2014 08:40 AM
Code to Print page 2 only Copy / Print Merge code ScottA Mail Merge 4 06-06-2014 07:32 PM
vba Code to Print Spreadsheet to PDF OTPM Excel Programming 3 05-25-2011 08:22 AM
Modify vba code to print based on name in the InputBox OTPM Project 0 05-25-2011 02:03 AM
VBA Code to Print Individual Resource Lists to a pdf File OTPM Project 0 05-24-2011 12:21 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:44 AM.


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