How to change paper size with VBA code?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Amjad Hussein
    New Member
    • Feb 2012
    • 12

    #1

    How to change paper size with VBA code?

    Hi Guys

    I have a small issue with page setup, you know that in page setup there is a printer paper, and drawing page, I know how to change the printer paper but I need also to change the drawing page to be same as printer paper size.
    I have used those codes to do this but still missing the code to make the drawing page to be same as a printer paper size, and also to change the drawing page orientation to be landscape!!!
    can you please help me with this?


    Code:
      
    vsDoc.PaperSize = visPaperSizeA3
    vsDoc.PrintLandscape = True
    vsDoc.PrintScale = 1
    vsDoc.PrintCenteredH = True
    vsDoc.PrintCenteredV = True
    Set vsPage = vsDoc.Pages(1)
    vsPage.PageSheet.CellsU("PrintPageOrientation").Formula = "2"


    Those codes will change the printer paper only, I need to change the drawing page as well!!!

    Thank you in advance for your help...

    Regards
Working...