Print to PDF not so cute

Regarding this post;

I have changed it (the attached macro) as follows to print to CutePDF and to select A3, but it still prints to the default office printer, and does not select A3 size, it only defaults to A4. Please have a look at this code and see where I am going wrong - (one of my first attempts at API - please excuse my ignorance!)

Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swPageSetup As SldWorks.PageSetup

Const Printer As String = "CutePDF" 'replace you Printer name here

Sub main()
   
    Set swApp = Application.SldWorks
   
    Set swModel = swApp.ActiveDoc
   
    Set swPageSetup = swModel.PageSetup
   
   'Debug.Print swPageSetup.PrinterPaperSize
    'Debug.Print swModel.Printer
   
    'A4 = 9, A3 = 8
    swPageSetup.PrinterPaperSize = 8 ' set your paper size here
   
    swPageSetup.Orientation = 2   ' 1=Portrait  '2 = Landscape
   
    swModel.Extension.PrintOut2 Empty, 1, False, Printer, ""
   
End Sub

  • should I rather install Primo pdf (currently l have CutePDF) if it works successfully?
  • I have used both in the past, they appear very similar - and both free!!!
  • as previous post, I have found that printing to pdf is preferable to save as pdf to avoid the various glitches that have been found to crop up.

any help greatly appreciated

TIA, cheers

Mike

SolidworksApi macros