Printer Object [Access 2003 VBA Language Reference]
A Printer object corresponds to a printer available on your system.
Using the Printer object
A Printer object is a member of the Printers collection.
To return a reference to a particular Printer object in the Printer s collection, use any of the following syntax forms.
|Printer s!devicename||The devicename argument is the name of the Printer object as returned by the DeviceName property.|
|Printer s("devicename")||The devicename argument is the name of the Printer object as returned by the DeviceName property.|
|Printer s(index)||The index argument is the numeric position of the object within the collection. The valid range is from 0 to |
You can use the properties of the Printer object to set the printing characteristics for any of the printers available on your system.
Use the LeftMargin , RightMargin , TopMargin , BottomMargin , ColumnSpacing , RowSpacing , DataOnly , DefaultSize , ItemLayout , ItemsAcross , ItemSizeHeight , and ItemSizeWidth properties to specify how Microsoft Access should format the appearance of data on printed pages.
The following example displays system information about the first printer in the Printers collection.
Dim prtFirst As Printer Set prtFirst = Application.Printers(0) With prtFirst MsgBox "Device name: " & .DeviceName & vbCr _ & "Driver name: " & .DriverName & vbCr _ & "Port: " & .Port End With