|
-
May 17th, 2005, 12:59 PM
#1
Thread Starter
Lively Member
Printing from application to network printer...Nobody knows???
Hope I'm on the correct forum for my question. I am naming a particular printer for a form to print to in my vb app. The printer is called "Form Printer on Server1" where Server1 is the server name the printer was installed on. On each workstation I installed that printer and the program works fine on all except two workstations. I have found that when I install the printer on those 2 workstations, the Windows 'Printer Install' software does not accept the way I type in "Server1" and it changed it to something like "sErVer1" on one workstation and to "SERver1" on the other one. So when I run the app, the printer named in the app as being on "Server1" is not found and the data prints to that workstation's default printer.
Does anybody know where Windows picks up the server name when you install a printer? I went into the hosts file and entered the IP address of the server and the correct 'case' name (as Server1) but that did not help. Any ideas?
Last edited by rbrook; May 18th, 2005 at 08:20 AM.
Reason: need help
-
May 17th, 2005, 01:29 PM
#2
Re: Printing from application to network printer
Well, this is certainly a new one.
Are all workstations running the same desktop OS?
Same patches?
Same everything?
-
May 17th, 2005, 02:21 PM
#3
Re: Printing from application to network printer
I just use the IP address of the remote printer. Are you using the CDC and ShowPrinter ? It has been found to be very unreliable.
Here is better code to use: http://support.microsoft.com/kb/322710/EN-US/#7
-
May 17th, 2005, 03:20 PM
#4
Thread Starter
Lively Member
Re: Printing from application to network printer
Yes, all of the user's workstations have Wk2 installed. Here is the code in the app where I assign the printer.
Dim X As Printer
For Each X In Printers
If X.DeviceName = "\\Server1\Form Printer" Then
Set Printer = X
Exit For
End If
Next
-
May 17th, 2005, 03:32 PM
#5
Re: Printing from application to network printer
I use this, which highlights the default printer, but allows my program to change it. I have an app that reads the chosen printername from a file, and automatically sets that when the app starts.
For some reason I get the IP address instead of the server name. It might have something to do with AV software running on my machine.
VB Code:
Option Explicit
Private Sub Combo1_Click()
Dim p As String
Dim prt As Printer
p = Combo1.List(Combo1.ListIndex)
For Each prt In Printers
If prt.DeviceName = p Then
Set Printer = prt
End If
Next prt
End Sub
Private Sub Form_Load()
Dim x%
Dim prt As Printer
Combo1.Clear
For Each prt In Printers
Combo1.AddItem prt.DeviceName
Next prt
For x = 0 To Combo1.ListCount
If Combo1.List(x) = Printer.DeviceName Then
Combo1.TopIndex = x
Combo1.ListIndex = x
Exit Sub
End If
Next x
End Sub
-
May 18th, 2005, 08:18 AM
#6
Thread Starter
Lively Member
Re: Printing from application to network printer
I cannot find a solution to this problem. My application does find the printer when I use the code I pasted in here earlier, but it's the name on the printer at the workstation which is incorrect. I've tried to go into the printer properties to rename it, but the " on Server1" is not part of the name at that point. Please, does anybody know where the workstation could be picking up the crazy upper/lower cased name of the server it assigns to the printer when I do the install? I can find nobody anywhere who can figure this one out.
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
|