Access 2000: Changing the Pagesize of a Report at runtime

Hi

I don't think this is possible but its worth an ask anyway.  Is it possible to change the Pagesize of a Report from A4 to Letter and back without going into Design mode.  I need to be able to do this on a Windows 2000 Server machine that only has the Access 2000 runtime installed.

Thanks



Stuart
LVL 2
thew00dAsked:
Who is Participating?
 
thenelsonCommented:
Yes, it is.  Not directly in Access VBA however.

1. Open up the Printing Preferences from Windows (not in Access) and set the settings you want for one setting.
2. In Run type:
    rundll32 printui.dll,PrintUIEntry /Ss /n "the printer name in quotes" /a "the path and name of a file to store the settings in quotes" u
    Example:  rundll32 printui.dll,PrintUIEntry /Ss /n "Okipage 10I" /a "C:\FolderA\OkiA4.ptr" u
    This will create a file with the settings you want.
3. In VBA code before the print command put:
     rundll32 printui.dll,PrintUIEntry /Sr /n "the printer name in quotes" /a "the path and name of a file to store the settings in quotes" u
    Example:  rundll32 printui.dll,PrintUIEntry /Sr /n "Okipage 10I" /a "C:\FolderA\OkiA4.ptr" u

Don't forget the "u" on the end or it will not work for anyone with less than Power User privledges.

This will change the settings for the printer for all applications on the computer so you would also want to save the printer settings to a file (with the /Ss switch) before changing it; then change it back to the original settings.

In my database, I have a form called Printer Settings where I can store the printer and its settings for every printing event in my database and a module that handles all the printer changes.  If you would like a copy of that, let me know.  I will pull it out, create a new demo db with just that in it and post it somewhere for you.

0
 
thew00dAuthor Commented:
Thanks for that - does the job perfectly.  If there's a demo db then I'm all for that - let me know where I can d/l it from.  If you don't get the time, then I should be able to come up with something myself.

Thanks


Stu
0
 
thenelsonCommented:
I'll have that demo db later today or tommarrow.  Glad I could help.
0
 
thenelsonCommented:
Stu,

I put the Printer Setup Demo.Zip at: http://www.nosuffering.com/Nelson/
0
 
thew00dAuthor Commented:
Got it.  Thanks again
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.