Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
PrintPreview | Excel Discussion (Misc queries) | |||
give me a hand,About printpreview | Excel Programming | |||
printpreview freezing | Excel Programming | |||
macro to disable the printpreview menu | Excel Programming | |||
[how to] VBA catching close/print in printpreview | Excel Programming |