Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA scripting Pete Excel Discussion (Misc queries) 2 January 9th 09 03:36 AM
Windows Scripting Host popup method has stopped timing out Curt[_2_] Excel Programming 2 February 15th 07 06:39 PM
Microsoft Windows 2000 Scripting Guide anonymous Excel Programming 1 April 11th 05 11:59 AM
Microsoft Windows 2000 Scripting Guide zumru Excel Programming 0 April 11th 05 11:02 AM
Windows Scripting Host/Windows XP V. Roe Excel Programming 0 May 13th 04 02:06 PM


All times are GMT +1. The time now is 04:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"