Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2005

Tip: Looking for answers? Try searching our database.

PRTDEVMODE

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phil Stanton - 27 Jan 2005 22:31 GMT
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
Allen Browne - 28 Jan 2005 02:41 GMT
PrtDevMode is not easy to work with, illustrated by the fact that Microsoft
got the Help file examples wrong in Access 95, 97, and 2000 (and probably
later versions - I gave up checking), and not just the same error (i.e. in
different places in different versions).

If you need to go this way, the best resource I can suggest is:
http://www.microsoft.com/AccessDev/Articles/GetzCh10.HTM

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Sorry to cross post, but getting no replies on the other Access NG
>
[quoted text clipped - 32 lines]
>
> Phil
PlusNet News - 28 Jan 2005 13:01 GMT
Thanks Allen.

Needs a bit of concentrated reading, but I think I can see the solution

Phil
> PrtDevMode is not easy to work with, illustrated by the fact that
> Microsoft got the Help file examples wrong in Access 95, 97, and 2000 (and
[quoted text clipped - 40 lines]
>>
>> Phil
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.