uncleelwyn
Technical User
HI,
trying to do a neat little project, which is to have an imagemap, of the printers in our office.
when a user clicks on a printer, it will call a vbscript routine to add the printer and set it as the default.
the sub is :
<script LANGUAGE="VBScript">
sub printer1()
Set WshNetwork = CreateObject("WScript.Network"
PrinterPath = "\\sydney\printer1" PrinterDriver = "Lexmark Optra S PS"
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
WshNetwork.SetDefaultPrinter "\\printerver.ourcompany.net\printer1"
msgbox "Your Printer Has been set to printer1"
end sub
</script>
and in the body I call it through :
<map name="FPMAP0"
...
<area HREF="#" OnClick=printer1() shape="rect" coords="794, 213, 868, 246">
</map>
...
what I'd like to do is instead of having a seperate sub for each printer, I'd like to pass the name of the printer to the routine, because I have a large amount of printers in the office.
Any ideas how I pass the printername into the sub?
Cheers.
trying to do a neat little project, which is to have an imagemap, of the printers in our office.
when a user clicks on a printer, it will call a vbscript routine to add the printer and set it as the default.
the sub is :
<script LANGUAGE="VBScript">
sub printer1()
Set WshNetwork = CreateObject("WScript.Network"
PrinterPath = "\\sydney\printer1" PrinterDriver = "Lexmark Optra S PS"
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
WshNetwork.SetDefaultPrinter "\\printerver.ourcompany.net\printer1"
msgbox "Your Printer Has been set to printer1"
end sub
</script>
and in the body I call it through :
<map name="FPMAP0"
...
<area HREF="#" OnClick=printer1() shape="rect" coords="794, 213, 868, 246">
</map>
...
what I'd like to do is instead of having a seperate sub for each printer, I'd like to pass the name of the printer to the routine, because I have a large amount of printers in the office.
Any ideas how I pass the printername into the sub?
Cheers.