Member | Description |
LeftMargin, RightMargin, TopMargin, BottomMargin | An Integer that specifies the distance between the edge of the page and the item to be printed in twips. |
DataOnly | An Integer that specifies the elements to be printed. When True (–1), prints only the data in a table or query in Datasheet view, form, or report, and suppresses labels, control borders, grid lines, and display graphics such as lines and boxes. When False (0), prints data, labels, and graphics. |
ItemsAcross | An Integer that specifies the number of columns across for multiple-column reports or labels. This member is equivalent to the value of the Number Of Columns box under Grid Settings on the Columns tab of the Page Setup dialog box. |
RowSpacing | An Integer that specifies the horizontal space between detail sections in units of 1/20 of a point. |
ColumnSpacing | An Integer that specifies the vertical space between detail sections in twips. |
DefaultSize | An Integer. When True, uses the size of the detail section in Design view. When False, uses the values specified by the ItemSizeWidth and ItemSizeHeight members. |
ItemSizeWidth | An Integer that specifies the width of the detail section in twips. This member is equivalent to the value of the Width box under Column Size on the Columns tab of the Page Setup dialog box. |
ItemSizeHeight | An Integer that specifies the height of the detail section twips. This member is equivalent to the value of the Height box under Column Size on the Columns tab of the Page Setup dialog box. |
ItemLayout | An Integer that specifies horizontal (1953) or vertical (1954) layout of columns. This member is equivalent to Across, Then Down or Down, Then Across respectively under Column Layout on the Columns tab of the Page Setup dialog box. |
FastPrint | Reserved. |
Datasheet | Reserved. |
Type str_PRTMIP
strRGB As String * 28
End Type
Type type_PRTMIP
intLeftMargin As Integer
intTopMargin As Integer
intRightMargin As Integer
intBotMargin As Integer
intDataOnly As Integer
intWidth As Integer
intHeight As Integer
intDefaultSize As Integer
intColumns As Integer
intColumnSpacing As Integer
intRowSpacing As Integer
intItemLayout As Integer
intFastPrint As Integer
intDatasheet As Integer
End Type
Sub PrtMipCols(strName As String)
Dim PrtMipString As str_PRTMIP
Dim PM As type_PRTMIP
Dim rpt As Report
Const PM_HORIZONTALCOLS = 1953
Const PM_VERTICALCOLS = 1954
DoCmd.OpenReport strName, acDesign
Set rpt = Reports(strName)
PrtMipString.strRGB = rpt.PrtMip
LSet PM = PrtMipString
PM.intColumns = 2 ' Create two columns.
PM.intRowSpacing = 0.25 * 1440 ' Set 0.25 inch between rows.
PM.intColumnSpacing = 0.5 * 1440 ' Set 0.5 inch between columns.
PM.intItemLayout = PM_HORIZONTALCOLS
LSet PrtMipString = PM ' Update property.
rpt.PrtMip = PrtMipString.strRGB
End Sub
The next PrtMip property example shows how to set all margins to 1 inch.
Sub SetMarginsToDefault(strName As String)
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
PM.intLeftMargin = 1 * 1440 ' Set margins.
PM.intTopMargin = 1 * 1440
PM.intRightMargin = 1 * 1440
PM.intBotMargin = 1 * 1440
LSet PrtMipString = PM ' Update property.
rpt.PrtMip = PrtMipString.strRGB
End Sub