Page Setup and Printing

Does anyone know how to set the options in the Page Setup dialog box?

What we have (code below) works if the options existing on the users machine are the same, else the code errors out.

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

Sub main()
       
    Set swApp = Application.SldWorks
   
    Set swModel = swApp.ActiveDoc
   
    Set swPageSetup = swModel.PageSetup
   
       
    'Debug.Print swModel.Printer
    'Debug.Print swPageSetup.PrinterPaperSize
    'Debug.Print swPageSetup.HighQuality
    'Debug.Print swPageSetup.Scale2
    'Debug.Print swPageSetup.Orientation
   
    'A4 = 9, A3 = 8, ARCH E1 = 138
    swPageSetup.PrinterPaperSize = 138
     
    swPageSetup.HighQuality = True
   
    swPageSetup.Scale2 = 100
   
    swPageSetup.Orientation = 2 ' 1=Portrait  '2 = Landscape
   
    Dim pageArray As Long
    pageArray = 0

    swModel.Extension.PrintOut2 pageArry, 1, False, "PRINTER", ""
   

   
End Sub

Thanks.

SolidworksApi macros