addwindowsprinterconnection

ideprize

Well-known member
Joined
Oct 19, 2011
Messages
97
Programming Experience
10+
The following code gives me an exception of filename, directory name, or volume label syntax.

Dim wh As New IWshRuntimeLibrary.IWshNetwork_Class
Dim strDfltPtr As String = "\\auto3\hphl"

wh.AddWindowsPrinterConnection(strDfltPtr)

Where auto3 is the server and hphl is the name of the printer.

Everything that I have read says this is valid syntax.
Any insights would be greatly appreciated

Respectfully,
Gordon Haas
 
Try that:
wh.AddWindowsPrinterConnection(strDfltPtr, "", strDfltPtr)
it means:
void IWshNetwork2.AddWindowsPrinterConnection(string PrinterName, string DriverName, string Port)
 
Back
Top