468,294 Members | 1,945 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,294 developers. It's quick & easy.

PrtDevMode I think

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
0 1045

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Gabriele Bertolucci | last post: by
2 posts views Thread by Esmee | last post: by
5 posts views Thread by Randy Harris | last post: by
23 posts views Thread by JDeats | last post: by
29 posts views Thread by GhostInAK | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.