P
Phil Stanton
Sorry to cross post, but getting no replies on the other Access NG
I have a report the size is A5 landscape. I need to get the page dimensions
using VBA.
If I open the report in PrintPreview I get
Using the well documented with such expressions as
strDevModeExtra = Rpt.PrtDevMode
' Gets current DEVMODE structure.
DevString.RGB = strDevModeExtra
I eventually get the information that
DM.intPaperLength = 2970 and
DM.intPaperWidth = 2100 and
DM.intOrientation = 1
This corresponds to A4 portrait.
I then open the report in design view, go to page set up. Change a margin
from 10mm to 11mm and back again to 10mm to force me to save the report. If
I then open the report in PrintPreview I get all the right answers i.e
DM.intPaperLength = 2100 and
DM.intPaperWidth = 1480 and
DM.intOrientation = 2
This is the correct A5 landscape.
How can I get the correct information using VBA
TIA
Phil
I have a report the size is A5 landscape. I need to get the page dimensions
using VBA.
If I open the report in PrintPreview I get
Using the well documented with such expressions as
strDevModeExtra = Rpt.PrtDevMode
' Gets current DEVMODE structure.
DevString.RGB = strDevModeExtra
I eventually get the information that
DM.intPaperLength = 2970 and
DM.intPaperWidth = 2100 and
DM.intOrientation = 1
This corresponds to A4 portrait.
I then open the report in design view, go to page set up. Change a margin
from 10mm to 11mm and back again to 10mm to force me to save the report. If
I then open the report in PrintPreview I get all the right answers i.e
DM.intPaperLength = 2100 and
DM.intPaperWidth = 1480 and
DM.intOrientation = 2
This is the correct A5 landscape.
How can I get the correct information using VBA
TIA
Phil