If you record a macro of you choosing those settings and printing it will get you most of the way. To get it to auto print to a specific printer adds a kink into it, though. With a function from here, I put this together and it seems to work.
You'll need to change the ".PaperSize" reference, since I don't have a Folio (8.5x13) option on my PC. Tabloid is 11x17. Also, if you try first by recording a macro, you'll see a plethora of additional PageSetup options you can change within VBA (margins, headers, etc.)
Sub Macro1()
Dim prntr As String
prntr = FindPrinter("Microsoft Print to PDF")
Application.ActivePrinter = prntr
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.PaperSize = xlPaperTabloid
End With
Application.PrintCommunication = True
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=10, Copies:=1
End Sub
Public Function FindPrinter(ByVal PrinterName As String) As String
Dim Arr As Variant
Dim Device As Variant
Dim Devices As Variant
Dim Printer As String
Dim RegObj As Object
Dim RegValue As String
Const HKEY_CURRENT_USER = &H80000001
Set RegObj = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
RegObj.enumvalues HKEY_CURRENT_USER, "Software\Microsoft\Windows NT\CurrentVersion\Devices", Devices, Arr
For Each Device In Devices
RegObj.getstringvalue HKEY_CURRENT_USER, "Software\Microsoft\Windows NT\CurrentVersion\Devices", Device, RegValue
Printer = Device & " on " & Split(RegValue, ",")(1)
If InStr(1, Printer, PrinterName, vbTextCompare) > 0 Then
FindPrinter = Printer
Exit Function
End If
Next
End Function
Bookmarks