T
TotallyConfused
I need help please. How do I send a Userfrom to print all 5 pages of my form
to print in landscape and the form to fit on a 8.5 x 11 sheet of paper.
After a lot of research I have the following code. It prints my form but
only the page I am when I hit the print button. I want all pages to print.
And how can you force it to print the form in one page. Right now it prints
the screen on 4 pages with parts of the form on all pages. I would
appreciate very much any help you can provide. Thank you.
Private Sub CommandButton6_Click()
UserForm2.PrintForm
ActiveSheet.PageSetup.Orientation = xlLandscape
' keybd_event VK_SNAPSHOT, 0, 0, 0
DoEvents
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY + _
KEYEVENTF_KEYUP, 0
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY + _
KEYEVENTF_KEYUP, 0
DoEvents
Workbooks.Add
Application.Wait Now + TimeValue("00:00:01")
ActiveSheet.PasteSpecial Format:="Bitmap", Link:=False, _
DisplayAsIcon:=False
ActiveSheet.Range("A1").Select
'added to force landscape
ActiveSheet.PageSetup.Orientation = xlLandscape
ActiveSheet.PageSetup.FitToPagesWide = 1
ActiveSheet.PageSetup.FitToPagesTall = 1
ActiveWindow.SelectedSheets.PrintOut Copies:=1
ActiveWorkbook.Close False
End Sub
to print in landscape and the form to fit on a 8.5 x 11 sheet of paper.
After a lot of research I have the following code. It prints my form but
only the page I am when I hit the print button. I want all pages to print.
And how can you force it to print the form in one page. Right now it prints
the screen on 4 pages with parts of the form on all pages. I would
appreciate very much any help you can provide. Thank you.
Private Sub CommandButton6_Click()
UserForm2.PrintForm
ActiveSheet.PageSetup.Orientation = xlLandscape
' keybd_event VK_SNAPSHOT, 0, 0, 0
DoEvents
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY + _
KEYEVENTF_KEYUP, 0
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY + _
KEYEVENTF_KEYUP, 0
DoEvents
Workbooks.Add
Application.Wait Now + TimeValue("00:00:01")
ActiveSheet.PasteSpecial Format:="Bitmap", Link:=False, _
DisplayAsIcon:=False
ActiveSheet.Range("A1").Select
'added to force landscape
ActiveSheet.PageSetup.Orientation = xlLandscape
ActiveSheet.PageSetup.FitToPagesWide = 1
ActiveSheet.PageSetup.FitToPagesTall = 1
ActiveWindow.SelectedSheets.PrintOut Copies:=1
ActiveWorkbook.Close False
End Sub