Function to know paper size

V

Vensia

Dear all,

Is there any function to know what paper size is used to preview/print the
report ?
Thanks.

Vensia
 
G

Guest

Hi There


This will do it but you might need to expand on it a bit, in particular, you
will have to
expand the Cases in the Select Case statement to accomodate the varieties of
paper you want to manage. Where you see "acPRPS10x14" and "acPRPSA4", you can
put what ever you want but I just used Access' default enumerations for
clarity. The statements I have included are wrong and only there as an
example IE Papertype 1 is not necessarily "acPRPS10x14" as shown below.

I advise that you look up the PaperSize Property in VBA help, and also
"AcPrintPaperSize" in the object browser in the VBA Editor



****************************************************
Function GetPaperSize(strRptName as String) as String

dim intPaperSizeEnum as int

intPaperSizeEnum = Reports(strRptName).Printer.PaperSize

SELECT Case intPaperSizeEnum
CASE 1 : GetPaperSize = "acPRPS10x14"
CASE 2 : GetPaperSize = "acPRPSA4"
CASE ELSE: GetPaperSize = "(Unknown)"
END SELECT

End Function
*************************************

Good luck!!
Mr. Smith.
 

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