Page Setup - paper size

S

Sean

Hi All!

Thank for reading this posting first!

I have a problem dealing with Page Setup.

My customer requests me to make the <report paper size setting> to be
synchronize with the <setting in default printer>. For example:

At first, the paper size for ReportA is <Letter>. But my customer A do not
like <Letter> size. He wants it to be <A4> size. He wish to change the
setting in the default printer only and the new setting can be apply to all
reports.

Is this possible???

Thank you very much!
 
W

Wayne Morgan

Use

If Me.UseDefaultPrinter = True Then

to determine if the report is using the default printer, if so then use the
code here to get the name of the default printer.

http://www.tek-tips.com/faqs.cfm?fid=5479

Once you have the default printer's name, you can use the
Application.Printers object to set the paper size.

Application.Printers(strDefaultPrinterName).PaperSize = acPRPSA4
 
S

Sean

Thanks for your reply!

Yes, your code helps a lot.

My customer request me to bind the <Report Paper Size> with the <Default
Printer Paper Size>.
It is for the convenient of the customer. Whenever they change the Paper
Size of their Default Printer, they wish that the Report inside my MDE will
follow the new setting accordingly.

Is the request possible to be done?

Thank you very much!
 
S

Sean

Thanks for your reply!

Yes, your code helps a lot.

My customer request me to bind the <Report Paper Size> with the <Default
Printer Paper Size>.
It is for the convenient of the customer. Whenever they change the Paper
Size of their Default Printer, they wish that the Report inside my MDE will
follow the new setting accordingly.

Is the request possible to be done?

Thank you very much!
 
S

Sean

Thanks for your reply!

Yes, your code helps a lot.

My customer request me to bind the <Report Paper Size> with the <Default
Printer Paper Size>.
It is for the convenient of the customer. Whenever they change the Paper
Size of their Default Printer, they wish that the Report inside my MDE will
follow the new setting accordingly.

Is the request possible to be done?

Thank you very much!
 
W

Wayne Morgan

Ok, that's a little different. For that to work, the printer would have to
report back to the printer driver what size paper is in the tray. Some of
the big network printers will do that, most small printers don't. So
depending on whether or not the printer even sends this information, you may
not even have a place to get started.

For those that do send the information, you would have to then interface
with the driver to get the information. I don't know how to go about doing
that. I'm guessing that you would have to call functions in some of the
driver's dll files to get the information. Once you have the information,
you may have to scale the report to fit the new paper size. Depending on the
report, that may be a monumental task. If the paper was just longer, it may
not be a big deal. You'd just have more detail items per page, but if the
paper width changed then the entire alignment of the report may change
unless you just leave white space where the paper got larger or let the
report print on two pages to make up for smaller paper.
 
B

Brendan Reynolds

For whatever it might be worth, US Letter is wider but shorter than A4, so
if you design portrait-oriented reports to fit on A4, and landscape-oriented
reports to fit on US Letter, they will print on either one, you just get a
wider right margin when using one paper size than when using the other.

Unless, or course, precise vertical positioning is required, as when
printing on to pre-printed forms, but in that case the pre-printed forms
will usually be printed on one particular size of paper.
 
S

Sean

Thanks for your information. I will check with my customer what is the paper
used.
And try to find an alternative solution to this problem!

Thank you!
 
S

Sean

Just to share with you.
I discovered one possible way that might be able to get the default paper
size in a printer without having to interact with the printer using its
driver.
But I do not know whether it will works.

Ok, every PC will have a default printer setting in <Control Panel |
Printers and Faxes>.
Is there a way to access the settings in the <Default Printer>?
If yes, that would be great and save a lot of works!

I will continue to search <How to access the Default Printer Setting> in
other newsgroup.

Many thans!!!
 
W

Wayne Morgan

Again, if the information is available in the drive, you can get to it. What
you'll need is an SDK (software developer kit) or other documentation from
the driver's writer that tells you how to talk to the driver.
 
S

Sean

Your response is fast!

I will search more technical paper regarding the SDK.

Many thanks for the information!
 

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