Access - Report.Printer.Papersize returns incorrect value (32512)

ironfelix717

Registered User.
Local time
Today, 18:29
Joined
Sep 20, 2019
Messages
193
Sorry for bombarding the forums today lol...

I am trying to get the paper size of a report and return the acPaperSize to see what the report's current paper size is set to for printing.

The result returned for a report with 'Letter' paper size in page setup gives value of 32512 when it should be returning 1! See here: PaperSize

Code Example:
Code:
dim rep as report
Set rep = Reports(ReportName)
MsgBox rep.Printer.PaperSize

None of the documentation says anything about 32512 (surprise).

Ideas?
Thanks
 
Not sure why you'd ever need to do this but, just to check. is your report open when you run that code
 
Colin,
If the report is not open, you get an error message saying it cannot be found?

Just tried the code and works fine for me.
 
The report has to be open to set the object.

Unless someone has a better way to get the paper size of a report.... which seems relatively trivial.
 
I asked whether it was open for precisely that reason...
Whilst I've never needed to use this code, it worked perfectly for me on an open report - return value = 9 (A4)
 
maybe somehow the 32512 not twips, but probably a similar concept.

it's curious. 32512 is 256*127
 

Users who are viewing this thread

Back
Top Bottom