LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default PrintPreview Question

To All,

I'm using the following Function:

What I'm questioning, is - Is there a way to initiate a PrintPreview
at a specific start page?

My First attempt allows Specific pages to be printed, but PrintPreview
ALWAYS initiates from Page 1

My Second attempt, I tried to Set .FirstPageNumber in PageSetup prior
to calling PrintPreview ... but it does nothing?

Any thoughts on how I can improve this Function?
Thanks in advance for any assistance,

JimP

'''''''1st attempt''''''''''''''''''''''''''''
Function PageToPrintOrView(iStart As Integer, iFinish As Integer, _
iPrintOrView As Integer)
'------------------------------------------
' Routine receives:
' PRINT Page Start#,
' PRINT Page Finish#, and
' PrintOrView: 0 = SEND TO PRINTER ... 1 = Print PREVIEW
indicator
'------------------------------------------
ActiveSheet.Select
If iPrintOrView Then
ActiveWindow.SelectedSheets.PrintPreview ' PREVIEW
Else
ActiveWindow.SelectedSheets.PrintOut From:=iStart, To:=iFinish,
_
Copies:=1, Collate:=True ' PRINT
End If
Range("A1").Select
End Function


''''''''2nd attempt''''''''''''''''''''''''''''''''''''
Function PageToPrintOrView(iStart As Integer, iFinish As Integer, _
iPrintOrView As Integer)
'------------------------------------------
' Routine receives:
' PRINT Page Start#,
' PRINT Page Finish#, and
' PrintOrView: 0 = SEND TO PRINTER ... 1 = Print PREVIEW
indicator
'------------------------------------------
ActiveSheet.Select
If iPrintOrView Then
' Try to Set .FirstPageNumber in PageSetup in PageSetup
With ActiveSheet.PageSetup
.FirstPageNumber = iStart
End With
ActiveWindow.SelectedSheets.PrintPreview ' PREVIEW
' Reset .FirstPageNumber in PageSetup
With ActiveSheet.PageSetup
.FirstPageNumber = xlAutomatic
End With
Else
ActiveWindow.SelectedSheets.PrintOut From:=iStart, To:=iFinish,
_
Copies:=1, Collate:=True ' PRINT
End If
Range("A1").Select
End Function
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PrintPreview Gerry Verschuuren Excel Discussion (Misc queries) 5 October 23rd 07 06:24 PM
give me a hand,About printpreview tiger liu Excel Programming 1 July 22nd 04 10:27 AM
printpreview freezing GregJG[_10_] Excel Programming 0 July 4th 04 12:01 AM
macro to disable the printpreview menu luis ortiz[_2_] Excel Programming 0 October 18th 03 03:16 PM
[how to] VBA catching close/print in printpreview Héctor Miguel Excel Programming 0 August 16th 03 02:28 AM


All times are GMT +1. The time now is 08:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"