Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 627
  • Last Modified:

How to set Margins and Paper orientation from VBA for PrintReview

I have many forms that are displayed maximized (both screen size and long forms) and have a PrintPreview function attached that sends these forms to printpreview.

I'm upgrading this function and adding resizing to fit an 8.5 x 11 inch page less margins and depending on horizonal to vertial aspect either portrait or landscape.

How do I access the page margins and set the page orientation from VBA?   Also can you explain where I can find this information as I really hate having to ask all the time for this type of info.

Thanks

Elton

 
0
katzwhite
Asked:
katzwhite
  • 2
1 Solution
 
shanesuebsahakarnCommented:
You could do this using the PrtMip property, but this is read-only unless you are in design view. You can open the form in design view using the DoCmd.OpenForm statement and then modify the PrtMip property accordingly (which means the print preview couldn't be placed on the form that you want to change, so I don't know if this is suitable.

To find more info on this property (plus other VBA properties, methods and functions), press F1 when viewing a code module tobring up VBA help (in Access 97, you can just open help from anywhere, it's all in one file). Type PrtMip into the Answer Wizard and it's got a good example listed as well.
0
 
katzwhiteAuthor Commented:
I also found Prtdevmode which I think will allow changing the paper origination.

Thanks for the Assistance

Elton

0
 
shanesuebsahakarnCommented:
NP, glad I could help point you in the right direction!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now