I'm having a hard time trying to run printer's properties via VB. Does anyone know how to do it?
------------------
Visual Basic Programmer (at least I want to be one)
------------------
PolComSoft
You will hear a lot about it.
Printable View
I'm having a hard time trying to run printer's properties via VB. Does anyone know how to do it?
------------------
Visual Basic Programmer (at least I want to be one)
------------------
PolComSoft
You will hear a lot about it.
Sure, use the PrinterProperties API, eg.
Code:Private Declare Function PrinterProperties Lib "winspool.drv" (ByVal hwnd As Long, ByVal hPrinter As Long) As Long
Private Declare Function OpenPrinter Lib "winspool.drv" Alias "OpenPrinterA" (ByVal pPrinterName As String, phPrinter As Long, pDefault As Any) As Long
Private Declare Function ClosePrinter Lib "winspool.drv" (ByVal hPrinter As Long) As Long
Private Sub Command1_Click()
Dim lhPrinter As Long
If OpenPrinter(ByVal Combo1, lhPrinter, ByVal 0&) Then
Call PrinterProperties(hwnd, lhPrinter)
Call ClosePrinter(lhPrinter)
End If
End Sub
Private Sub Form_Load()
Dim oPRN As Printer
For Each oPRN In Printers
Combo1.AddItem oPRN.DeviceName
Next
Combo1 = Printer.DeviceName
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
Thanks Again Aaron
------------------
Visual Basic Programmer (at least I want to be one)
------------------
PolComSoft
You will hear a lot about it.