Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DoCmd.PrintOut properties?

Status
Not open for further replies.

RichCraig

Programmer
Joined
Feb 13, 2003
Messages
54
Location
GB
Hi

Im using

DoCmd.PrintOut acSelection

to print out my form, but need to set it to print out in
landscape format
scale to fit page
edit the margins

does anyone know how to do this?
 
RichCraig,

Don't know if you can do it for a form, but to change for reports chack out PrtDevMode & PrtMip from Access2k Properties reference.
As an example (from ms a2k help):
The following example shows how to change the orientation of the report. This example will switch the orientation from portrait to landscape or landscape to portrait depending on the report's current orientation.

Sub SwitchOrient(strName As String)
Const DM_PORTRAIT = 1
Const DM_LANDSCAPE = 2
Dim DevString As str_DEVMODE
Dim DM As type_DEVMODE
Dim strDevModeExtra As String
Dim rpt As Report
' Opens report in Design view.
DoCmd.OpenReport strName, acDesign
Set rpt = Reports(strName)
If Not IsNull(rpt.PrtDevMode) Then
strDevModeExtra = rpt.PrtDevMode
DevString.RGB = strDevModeExtra
LSet DM = DevString
DM.lngFields = DM.lngFields Or _
DM.intOrientation ' Initialize fields.
If DM.intOrientation = DM_PORTRAIT Then
DM.intOrientation = DM_LANDSCAPE
Else
DM.intOrientation = DM_PORTRAIT
End If
LSet DevString = DM ' Update property.
Mid(strDevModeExtra, 1, 94) = DevString.RGB
rpt.PrtDevMode = strDevModeExtra
End If
End Sub

HTH

Regards,
longhair
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top