varunvithalani
Registered User.
- Local time
- Today, 18:53
- Joined
- May 11, 2010
- Messages
- 19
Hello,
I wish to automatically set narrow margins and orientations before issuing a print command in the code.
This is what I have done so far:
Application.Printer.Orientation = acPRORLandscape
Application.Printer.BottomMargin = 362.834645669
Application.Printer.TopMargin = 362.834645669
Application.Printer.LeftMargin = 362.834645669
Application.Printer.RightMargin = 362.834645669
RunCommand acCmdPrintPreview
RunCommand acCmdPrint
This code works well and good on my computer which has NO PRINTERS INSTALLED. Thus the default is 'MS XPS Viewer'.
Now when I try to run the same file in another PC which has an HP printer installed, the program absolutely ignores the orientation and margin commands and shows a preview in potrait mode with normal margins.
I was wondering that the issue could be with the problem of the default printer. I need to construct the program such that it is generic and it sets the defalult printer automatically.
Kindly help with your inputs.
Thanks
I wish to automatically set narrow margins and orientations before issuing a print command in the code.
This is what I have done so far:
Application.Printer.Orientation = acPRORLandscape
Application.Printer.BottomMargin = 362.834645669
Application.Printer.TopMargin = 362.834645669
Application.Printer.LeftMargin = 362.834645669
Application.Printer.RightMargin = 362.834645669
RunCommand acCmdPrintPreview
RunCommand acCmdPrint
This code works well and good on my computer which has NO PRINTERS INSTALLED. Thus the default is 'MS XPS Viewer'.
Now when I try to run the same file in another PC which has an HP printer installed, the program absolutely ignores the orientation and margin commands and shows a preview in potrait mode with normal margins.
I was wondering that the issue could be with the problem of the default printer. I need to construct the program such that it is generic and it sets the defalult printer automatically.
Kindly help with your inputs.
Thanks