By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,316 Members | 2,355 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,316 IT Pros & Developers. It's quick & easy.

PrtDevMode I think

P: n/a
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
Nov 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.