A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Code for Printer Setup



 
 
Thread Tools Display Modes
  #1  
Old August 10th, 2007, 09:28 PM posted to microsoft.public.access.reports
Joseph
external usenet poster
 
Posts: 224
Default Code for Printer Setup

I know that this has been asked a million times before. And the title is
always different, so the posibilty of finding the correct answer is probably
very low. But has there been any updates in the way that a printer setup can
be controlled with VBA or Macro coding?
The reports in my databases switch from portrait to landscape, plus my
databases are networked, with different printers. And with the myraid of
printers out there, I do not want to have code for every single different
printer type out there.
I have just upgraded to Office2007 and am in the process of converting over
the databases. Before, I would get calls about why the reports were coming
out different (portrait/landscape) and I could not give a good enough answer
nor could I find a resolution to the problem other than coding for each
individual printer in the company.
Any answers would be helpful since I am about to purchase new printers.


  #2  
Old August 11th, 2007, 03:42 AM posted to microsoft.public.access.reports
Allen Browne
external usenet poster
 
Posts: 11,706
Default Code for Printer Setup

Okay, you are asking how you can programmatically assign a printer to a
report at runtime, and set its orientation.

Since Access 2002, Access has a Printer object. Before you OpenReport, you
can assign it to one of the Printers available on the user's machine, and
the report will go to that printer. Then you need to set the Printer to
Nothing again; otherwise all their reports go to that printer (rather than
their default.)

If you want that to persist, you can store the info in a table, or create a
custom property for the report so it emembers to send that report to that
printer. There's a downloadable example of how to do that he
Printer Selection Utility - Users assign printers to reports
at:
http://allenbrowne.com/AppPrintMgt.html

You can also set the orientation and margins programmatically once the
report is open in preview. See the SetMarginsAndOrientation() function at
the end of this page:
http://allenbrowne.com/AppRelReportCode.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Joseph" wrote in message
...
I know that this has been asked a million times before. And the title is
always different, so the posibilty of finding the correct answer is
probably
very low. But has there been any updates in the way that a printer setup
can
be controlled with VBA or Macro coding?
The reports in my databases switch from portrait to landscape, plus my
databases are networked, with different printers. And with the myraid of
printers out there, I do not want to have code for every single different
printer type out there.
I have just upgraded to Office2007 and am in the process of converting
over
the databases. Before, I would get calls about why the reports were
coming
out different (portrait/landscape) and I could not give a good enough
answer
nor could I find a resolution to the problem other than coding for each
individual printer in the company.
Any answers would be helpful since I am about to purchase new printers.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:25 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.