Function to know paper size

  • Thread starter Thread starter Vensia
  • Start date Start date
V

Vensia

Dear all,

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

Vensia
 
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.
 
Back
Top