Access 2013 Set Printer Page Format from vba

I use this code to print a weekly meeting agenda and I have been manually adjusting the report in acrobat to print an 11x17 working copy for note taking - I would like to automate this process without creating a 2nd report

    WkgWklyMtgRptFilter = "[ContractId] = " & """" & Forms![0_masterdatafrm]![DefaultContrId] & """" & " and [MeetingNumber] = " & Me![MeetingNumber]
    RptNm = "80_ConstrMtgAgendaWkgRpt"
    RptNmlng = Forms![0_masterdatafrm]![DefaultContrId] & " MRWMD Truck Haul Project Wkly Cnstr Mtg Agenda " & Format(Me![MeetingNumber], "000") & " " & Format(Me![MeetingDate], "mm-dd-yyyy") & ".pdf"
   
    DoCmd.OutputTo objecttype:=acOutputReport, objectname:=RptNm, OutputFormat:=acFormatPDF, OutputFile:=PrntPath & RptNmlng
J--14-Jobs-14040-MRWMD---Owners-Rep---CM
J--14-Jobs-14040-MRWMD---Owners-Rep---CM
rogerdjrAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hnasrCommented:
Check this link for Printer object.
https://msdn.microsoft.com/en-us/library/office/ff837177.aspx

Click Printer Object Members for required Printer Settings.
0
rogerdjrAuthor Commented:
Tried this code based on the link - it changes the printer named Adobe PDF to landscape 11 x 17 but doesn't print an 11 x 17 report?

Private Sub PrintTabloidPdfsBtn_Click()

    Dim strDistillerPrinter As String
    Dim strPrinterName As String, strDefaultPrinter As String
    Dim prt As Access.Printer
    Dim Orientation As Integer, PaperSize As Integer
   
    Dim WkgWklyMtgRptFilter As String, RptNm As String, RptNmlng As String

'1.  Get the name of the system default printer
            strDefaultPrinter = application.Printer.DeviceName
'2.  Get the name of the Distiller printer
    'Make Sure the Acrobat Printer is setup to print directly to the printer
            For Each prt In application.Printers
                strPrinterName = prt.DeviceName
'                MsgBox strPrinterName
               
                If prt.DeviceName = "Adobe PDF" Then
                    MsgBox prt.Orientation & vbNewLine & prt.PaperSize & vbNewLine
                    Orientation = prt.Orientation '(1 portrait, 2 landscape)
                    PaperSize = prt.PaperSize '(1 letter, 17 11x17)
                   
                    prt.Orientation = acPRORLandscape
                    prt.PaperSize = acPRPS11x17
                   
                    MsgBox prt.Orientation & vbNewLine & prt.PaperSize & vbNewLine
                   
                    'Agenda
       
                    WkgWklyMtgRptFilter = "[ContractId] = " & """" & Forms![0_masterdatafrm]![DefaultContrId] & """" & " and [MeetingNumber] = " & Me![MeetingNumber]
                    RptNm = "80_ConstrMtgAgendaWkgRpt"
                    RptNmlng = Forms![0_masterdatafrm]![DefaultContrId] & " MRWMD Truck Haul Project Wkly Cnstr Mtg Agenda " & Format(Me![MeetingNumber], "000") & " " & Format(Me![MeetingDate], "mm-dd-yyyy") & " Tabloid .pdf"
PrntPath = "j:\0\"
                    DoCmd.OutputTo objecttype:=acOutputReport, objectname:=RptNm, OutputFormat:=acFormatPDF, OutputFile:=PrntPath & RptNmlng

                    prt.Orientation = Orientation
                    prt.PaperSize = PaperSize
                End If
               
            Next




End Sub
0
hnasrCommented:
Add: Reports(RptNm).Printer = Prt

Reports(RptNm).Printer = Prt
DoCmd.OutputTo objecttype:=acOutputReport, objectname:=RptNm, OutputFormat:=acFormatPDF, OutputFile:=PrntPath & RptNmlng

Open in new window


Compare with this code to print page 1 of  a form Form on Printer "LaserJet 1". Try it on a form.
Private Sub Command4_Click()
    Dim p As Printer
    Set p = Application.Printers("LaserJet 1")
    Me.Printer = p
    p.Orientation = acPRORLandscape
    DoCmd.PrintOut acPages, 1, 1
Exit Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.