I am on an active directory network, and I want to print to my network printer on cheesesvr -- The ip of the printer is 192.168.56.4 -- How would I go about printing the end variable?
Printable View
I am on an active directory network, and I want to print to my network printer on cheesesvr -- The ip of the printer is 192.168.56.4 -- How would I go about printing the end variable?
I'd use a combobox to select printers, as the common dialog control has problems. I do this in the form_activate, to select the default printer.
VB Code:
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
and then this, to change it:
VB Code:
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