Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Compare Database
Option Explicit
Type str_PRTMIP
strRGB As String * 28
End Type
Type type_PRTMIP
xLeftMargin As Long
yTopMargin As Long
xRightMargin As Long
yBotMargin As Long
fDataOnly As Long
xWidth As Long
yHeight As Long
fDefaultSize As Long
cxColumns As Long
yColumnSpacing As Long
xRowSpacing As Long
rItemLayout As Long
fFastPrint As Long
fDatasheet As Long
End Type
Type zwtDevModeStr
RGB As String * 94
End Type
Type zwtDeviceMode
dmDeviceName As String * 16
dmSpecVersion As Integer
dmDriverVersion As Integer
dmSize As Integer
dmDriverExtra As Integer
dmFields As Long
dmOrientation As Integer
dmPaperSize As Integer
dmPaperlength As Integer
dmPaperWidth As Integer
dmScale As Integer
dmCopies As Integer
dmDefaultSource As Integer
dmPrintQuality As Integer
dmColor As Integer
dmDuplex As Integer
dmResolution As Integer
dmTTOption As Integer
dmCollate As Integer
dmFormName As String * 16
dmPad As Long
dmBits As Long
dmPW As Long
dmDFI As Long
dmDRr As Long
End Type
Sub CheckPageSize(rptName As String)
'[URL unfurl="true"]http://msdn2.microsoft.com/en-us/library/aa207072(office.10).aspx[/URL]
Dim DevString As zwtDevModeStr
Dim DM As zwtDeviceMode
Dim DevModeExtra As String
Dim rpt As Report
'Open the report in Design view.
DoCmd.OpenReport rptName, acDesign
Set rpt = Reports(rptName)
DevString.RGB = rpt.PrtDevMode
LSet DM = DevString
'Paper Size: [URL unfurl="true"]http://msdn2.microsoft.com/en-us/library/aa225944(office.10).aspx[/URL]
Debug.Print DM.dmPaperSize '9 = A4, see link
Debug.Print DM.dmPaperlength / 10 & " mm"
Debug.Print DM.dmPaperWidth / 10 & " mm"
End Sub
Sub CheckMargins(strName As String)
'[URL unfurl="true"]http://msdn2.microsoft.com/en-us/library/aa207075(office.10).aspx[/URL]
'1440 twips = 2.54 cm = 1 inch
'56.693 twips = 1 mm
Dim PrtMipString As str_PRTMIP
Dim PM As type_PRTMIP
Dim rpt As Report
DoCmd.OpenReport strName, acDesign
Set rpt = Reports(strName)
PrtMipString.strRGB = rpt.PrtMip
LSet PM = PrtMipString
Debug.Print Round(PM.yTopMargin / 56.693, 2) & " mm"
Debug.Print Round(PM.yBotMargin / 56.693, 2) & " mm"
Debug.Print Round(PM.xLeftMargin / 56.693, 2) & " mm"
Debug.Print Round(PM.xRightMargin / 56.693, 2) & " mm"
End Sub