Has anyone got any ideas on how I can effectively create a ‘picklist’ of the users installed printers…
Any suggestions considered !
L.
Has anyone got any ideas on how I can effectively create a ‘picklist’ of the users installed printers…
Any suggestions considered !
L.
Subject: Picklist for printers
You would have to use some API calls and LotusScript to “talk” to Windows. You’ll probably need to go read up on some other programming languages to see how it is done in general and then apply a similar technique.
Of course the question would be why are you doing this? I don’t think you can force Notes to print to a specific printer anyway.
Subject: Picklist for printers
Sub getCurrentPrinterList Dim oWSHNet As Variant
Set oWSHNet = CreateObject("WScript.Network")
Dim i As Integer
Dim nCount As Integer
Dim sPrinterName As String
Dim oPrinters As Variant
Set oPrinters = oWSHNet.EnumPrinterConnections()
Dim nNumPrinters As Integer
nNumPrinters = oPrinters.count()/2
nCount = 0
For i = 0 To oPrinters.Count() - 1 Step 2
sPrinterName = Ucase$(oPrinters.Item(i+1))
Print nCount & ") " & sPrinterName & " - " & oPrinters.Item(i)
nCount = nCount + 1
Next
End Sub
Subject: RE: Picklist for printers
Many thanks for the suggestion… I have actually found a solution through the 4/5 forum.
For background info the reason I’m doing this is to do a backend print onto a user-chosen printer. The format of the print is onto a label so to handle the text rotation I’m pumping the detail into excel, formatting it, printing then backend close of excel - so the user just hears the satisfying buzz of the printer.
This works fine… however the printer name alone is not enough… I also need the port… for example my print param is Dymo Labelwriter xxx on Ne05:
What is the Ne05 ?? Glad you asked… my printer is installed on a usb port… I can’t seem to get a handle on what this is going to be until I try it. OK for me but no good for users without any knowledge of how to find out the parameter needed to add to the printer name.
Any further knowledge on specifying printers is gratefully received…
By the way I have no guarantee that the user won’t be using their COM 1 (or other port) so wanted to pull the list of printers (together with the port param) for them to pick themselves.
The list of printer names is fine it’s the ports I’m stuck on…
Subject: RE: Picklist for printers
The code I posted shows the printer name and the port.
Subject: RE: Picklist for printers
Thanks for much for posting this code. Here it is six years later, still benefiting others.