Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Windows Scripting
Hi,
I was doing a project in Excel VBA where I needed to capture the list of installed printers on user's machine and based on that I wanted to limit access to certain printers. I have heard that Windows Scripting can help tremendously in such tasks. Does anyone know about a site on the web where I can explore more about this feature? Thanks & best regards Anant |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Windows Scripting
Anant,
What do you by "limit access to certain printers" ? Presumably the user has permission to all the printers installed on the system. Do you mean that certain files should only be printed on certain printer(s) ? NickHK "Anant Basant" wrote in message ... Hi, I was doing a project in Excel VBA where I needed to capture the list of installed printers on user's machine and based on that I wanted to limit access to certain printers. I have heard that Windows Scripting can help tremendously in such tasks. Does anyone know about a site on the web where I can explore more about this feature? Thanks & best regards Anant |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Windows Scripting
You can find about Windows Scripting at Microsoft Script Center:
http://www.microsoft.com/technet/scr...r/default.mspx Most of the samples are VBScript, but I think you can easily convert them to VBA. Here is a sample script that lists all the printers on local computer: Sub ListPrinters() strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & strComputer & "\root\cimv2") Set colInstalledPrinters = objWMIService.ExecQuery _ ("Select * from Win32_Printer") For Each objPrinter In colInstalledPrinters Debug.Print "Name: " & objPrinter.Name Debug.Print "Location: " & objPrinter.Location Debug.Print "Default: " & objPrinter.Default Next End Sub Hope this is of some help. -- urkec "Anant Basant" wrote: Hi, I was doing a project in Excel VBA where I needed to capture the list of installed printers on user's machine and based on that I wanted to limit access to certain printers. I have heard that Windows Scripting can help tremendously in such tasks. Does anyone know about a site on the web where I can explore more about this feature? Thanks & best regards Anant |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Windows Scripting
Hi Nick,
I wanted to have the list of installed printers in a combobox, from where users can choose the printer they want, and also I could limit the list such that certain printers (color printers) do not appear in the list. If I use the option of default print dialog box in my macro, it would list all the printers available to the user, that is why I didn't want to use this option. Further I have found a script centre at http://www.microsoft.com/technet/scr...r/default.mspx where I can learn more about scripting. Thanks very much for your note. Regards Anant "NickHK" wrote in message ... Anant, What do you by "limit access to certain printers" ? Presumably the user has permission to all the printers installed on the system. Do you mean that certain files should only be printed on certain printer(s) ? NickHK "Anant Basant" wrote in message ... Hi, I was doing a project in Excel VBA where I needed to capture the list of installed printers on user's machine and based on that I wanted to limit access to certain printers. I have heard that Windows Scripting can help tremendously in such tasks. Does anyone know about a site on the web where I can explore more about this feature? Thanks & best regards Anant |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA scripting | Excel Discussion (Misc queries) | |||
Windows Scripting Host popup method has stopped timing out | Excel Programming | |||
Microsoft Windows 2000 Scripting Guide | Excel Programming | |||
Microsoft Windows 2000 Scripting Guide | Excel Programming | |||
Windows Scripting Host/Windows XP | Excel Programming |