|
-
Jan 27th, 2000, 08:00 PM
#1
Thread Starter
Hyperactive Member
I have an application that has to print to 2 printers. They are serial printers and I have this working fine useing MSCOMM
The problem is that more than one PC has to print to the printer.
I want to print the stuff using the windows printer drivers but how would I do this.
I have all the stuff on strings and just want to throw these to the printer.
Help please
-
Jan 27th, 2000, 11:20 PM
#2
Addicted Member
Are the printers shared ? If yes you can access them by choosing them in a printer dialog box or even directly (by code). If they are not shared I don't know if there is a way to communicate with a remote serial port.
------------------
Jorge Ledo
[email protected]
Portugal
-
Jan 28th, 2000, 10:07 AM
#3
Once you've add the Printers to the Printers Folder in Windows, you can Access them from VB via the Printer Object, ie.
Code:
Function SetPrinter(ByVal PrinterName As String) As String
Dim oPRN As Printer
For Each oPRN In Printers
If LCase(oPRN.DeviceName) = LCase(PrinterName) Then
SetPrinter = Printer.DeviceName
Set Printer = oPRN
Exit For
End If
Next
End Function
Use this Function to Set the Printer Object to a Specific Printer, by passing the Name of the Printer, ie.
sOldPrinter = SetPrinter("Generic/Text Only")
The Name of the Current Printer is Returned, so that if need be you can easily restore it by Calling the Function again.
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
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
|