A4 papersize

H

Harold

I am sharing a database with users ourside the United States.
I would like to determine before printing what the stored papersize is using
VBA.
If I can accomplish that, maybe I can avoid the maddening experience of
going to the printer only to discover it is waiting to for a papersize it
does not have ready.
 
A

Allen Browne

You should not need to assign paper size. Just leave the report set for
Default Printer (not a specific printer.) And make sure that the report
width + left margin + right margin does not exceed 8.27" (the width of A4),
e.g.:
left margin: 0.8"
right margin: 0.6"
report width: 6.25"

It is possible to open a report in design view programmatically and set the
PrtMip settings to define a particular paper size, but I don't see that is
necessary or desirable. If you want to go that way, see:
http://msdn.microsoft.com/en-us/library/aa207072(office.10).aspx
 
T

terri

Mr. Browne,

This assumes that 1) you always accommodate the least amount of paper-space
available and 2) you do not allow the user access to the Page Setup Dialog
where they may manually change the margins.

I am trying to address these concerns by making adjustments programmatically
in my report(s), but I am limited to using the 2000RT where the Printer
object is not available. Do you know of any way to read what the papersize
and margins settings are outside of the Printer object?

A previous post did not garner any responses. Any insight would be very much
appreciated.

Thanks!
 
A

Allen Browne

You can read that information from PrtDevMode.

I don't see a problem with the user using the printer dialog. In the runtime
(or in an MDE), it's not going to save that way, so the report will retain
the properties as you set them up at desgin time.
 
T

terri

Thank you for your response.

The Printer dialog isn't my concern, it's the Page Setup dialog. Typically
the user previews the report, which first opens with the saved settings; but
they can change the papersize and margins via Page Setup. The report then
re-displays with the changed settings. (Going directly to the printer,
obviously only the saved settings come into play.)

Anyway, I stumbled across the Report object's LogicalPageHeight and
LogicalPageWidth properties which provide me with what I was trying to
calculate -- the total amount of white space less the currently set margins.
For instance, my reports are typically saved as 8.5 x 11 with .5 margins
all-around. This returns 10,800 x 14,400; changed to A4 with .25 margins
and I get 11,184 x 16,114.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top