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

ironfelix717

Registered User.
Local time
Today, 17:32
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
 

isladogs

MVP / VIP
Local time
Today, 21:32
Joined
Jan 14, 2017
Messages
18,186
Not sure why you'd ever need to do this but, just to check. is your report open when you run that code
 

Gasman

Enthusiastic Amateur
Local time
Today, 21:32
Joined
Sep 21, 2011
Messages
14,047
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.
 

ironfelix717

Registered User.
Local time
Today, 17:32
Joined
Sep 20, 2019
Messages
193
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.
 

isladogs

MVP / VIP
Local time
Today, 21:32
Joined
Jan 14, 2017
Messages
18,186
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)
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 21:32
Joined
Sep 12, 2006
Messages
15,614
maybe somehow the 32512 not twips, but probably a similar concept.

it's curious. 32512 is 256*127
 

Users who are viewing this thread

Top Bottom