GetPrinters Method
|
Part | Description
|
PrinterCount | (Optional). Variant (Integer) expression that returns the number of printers found.
|
HP DeskJet 690C
|
FAX Printer
|
PDF Printer Driver
|
Dim ASPPrn As ASPPrinterCOM.ASPPrinter
|
Private Sub Form_Load()
|
Dim MyPrinters As Variant, I As Integer, PrnCount As Integer
|
|
'Get the names of installed printers
|
MyPrinters = ASPPrn.GetPrinters(PrnCount)
|
|
'Populate the combo box with the names
|
For I = 0 To PrnCount - 1
|
Combo1.AddItem MyPrinters(I)
|
Next
|
|
'Select the first printer name to show in the combo text
|
Combo1.ListIndex = 0
|
End Sub
|
|
|
Private Sub CommandPrint_Click()
|
'Specify some document text
|
ASPPrn.DocText="Hello World!"
|
|
'Print the document on the selected printer
|
ASPPrn.PrintDoc (Combo1.List(Combo1.ListIndex))
|
End Sub
|
|