Microsft used it in this context:
PrtDevNames Property
You can use the PrtDevNames property to set or return information about the
printer selected in the Print dialog box for a form or report.
Note It is strongly recommended that you consult the Win32 Software
Development Kit for complete documentation on the PrtDevMode, PrtDevNames,
and PrtMip properties.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/off2000/htm
l/acproPrtDevNames.asp
--
Dana Mansolillo
Technicalities Computer Training
Seekonk, MA
To day, you are lucky to even see the standard versions of VB, or C++ on the
store shelves. (learning editions are sometimes available). Everything today
is just games, and general office applications...but no developer stuff.
However, Any good quality computer store can and will order you that
developer stuff. You can also order from Microsoft directly. However, I see
little need if all you want is additional information print dev. I mean, it
is silly to go out purchase a whole package for just learning about one
thing. Besides, the documentation is avaaible on line at msdn.
Just like we often here use code to use the windows API, and as a safety
measure could say, for further reading check out the windows API
documentation. (however, that API doc thing is huge, no one really is gong
to read the whole thing!).
You would probably be much better off asking a few questions here as to what
you want. Most of the time the printdev stuff is used to control certain
printer stuff.
However, you don't need to worry about, or use the printdev stuff if you are
just changing the printer, or even trying to change the number of copes.
There are *much* easer approaches here.
However, A excellent source of info on printdev can be found at:
http://www.mvps.org/access/reports/rpt0009.htm
If you just to change the printer..then I have a very short and tiny printer
change program at:
http://www.attcanada.net/~kallal.msn/msaccess/msaccess.html
Perhaps the solution you are looking for is available already...it does not
hurt to ask....
--
Albert D. Kallal
Edmonton, Alberta Canada
kal...@msn.com
The code follows...
Option Compare Database
Option Explicit
Type str_DEVMODE
RGB As String * 94
End Type
Type type_DEVMODE
strDeviceName As String * 16
intSpecVersion As Integer
intDriverVersion As Integer
intSize As Integer
intDriverExtra As Integer
lngFields As Long
intOrientation As Integer
intPaperSize As Integer
intPaperLength As Integer
intPaperWidth As Integer
intScale As Integer
intCopies As Integer
intDefaultSource As Integer
intPrintQuality As Integer
intColor As Integer
intDuplex As Integer
intResolution As Integer
intTTOption As Integer
intCollate As Integer
strFormName As String * 16
lngPad As Long
lngBits As Long
lngPW As Long
lngPH As Long
lngDFI As Long
lngDFr As Long
End Type
Type str_PRTMIP
RGB As String * 28
End Type
Type type_PRTMIP
'Typed as longs due to Ansi to Unicode conversion
xLeftMargin As Long
yTopMargin As Long
xRightMargin As Long
yBottomMargin As Long
fDataOnly As Long
xItemSizeWidth As Long
yItemSizeHeight As Long
fDefaultSize As Long
xItemsAcross As Long
yColumnSpacing As Long
xRowSpacing As Long
rItemLayout As Long
rFastPrinting As Long
rDataSheetHeadings As Long
End Type
'-------------------------- Function -------------------------------------
Public Function SetReportOptions(strName As String, iSize As Integer, _
iOrientation As Integer, left!, top!, right!, bottom!)
On Error GoTo Err_SetReportOptions
'iSize : 1 Letter 5 Legal
'iOrientation : 1 Portrait 2 Landscape
DoCmd.Echo False
Dim rpt As Report
DoCmd.OpenReport strName, acDesign 'Opens report in Design view.
Set rpt = Reports(strName)
Reports(strName).Painting = False
Dim strDevModeExtra As String
Dim DevString As str_DEVMODE
Dim DM As type_DEVMODE
If Not IsNull(rpt.PrtDevMode) Then
strDevModeExtra = rpt.PrtDevMode
DevString.RGB = strDevModeExtra
LSet DM = DevString
DM.lngFields = DM.lngFields Or DM.intOrientation 'Initialize fields.
DM.intPaperSize = iSize 'Letter size
DM.intOrientation = iOrientation 'Landscape
LSet DevString = DM 'Update property.
Mid(strDevModeExtra, 1, 94) = DevString.RGB
rpt.PrtDevMode = strDevModeExtra
End If
Dim PrtMipString As str_PRTMIP
Dim PM As type_PRTMIP
Dim tempPrtMip As String
If IsNull(rpt.PrtMip) Then
DoCmd.SelectObject acReport, strName
DoCmd.Close acReport, strName, acSaveYes
DoCmd.Echo True
Exit Function
Else
PrtMipString.RGB = rpt.PrtMip
End If
LSet PM = PrtMipString
'Use 1440 for US (inches)
PM.xLeftMargin = left * 1440
PM.yTopMargin = top * 1440
PM.xRightMargin = right * 1440
PM.yBottomMargin = bottom * 1440
LSet PrtMipString = PM
rpt.PrtMip = PrtMipString.RGB
DoCmd.Save acReport, strName
'Make sure report has the focus
DoCmd.SelectObject acReport, strName
CloseRpt:
DoCmd.Close acReport, strName
DoCmd.Echo True
Exit_SetReportOptions:
Exit Function
Err_SetReportOptions:
MsgBox "There was an error setting printing options." & _
vbCrLf & "The report may not print properly.", vbCritical, "PRINTING
ERROR"
Resume Exit_SetReportOptions
End Function
--
Dana Mansolillo
Technicalities Computer Training
Seekonk, MA
"Albert D. Kallal" <kal...@msn.com> wrote in message
news:u%6g9.298724$v53.15...@news3.calgary.shaw.ca...