|
-
Nov 12th, 1999, 12:44 PM
#1
Thread Starter
Fanatic Member
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.
-
Nov 12th, 1999, 01:20 PM
#2
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]
-
Nov 12th, 1999, 01:25 PM
#3
Thread Starter
Fanatic Member
Thanks Again Aaron
------------------
Visual Basic Programmer (at least I want to be one)
------------------
PolComSoft
You will hear a lot about it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|