View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Detect printer properties

Hi Jos,

WMI can be used to retrieve the printerconfiguration properties BUT you
cannot manipulate them using WMI as they are readonly.

However the code below lists only the standard props.

Go into the immediate pane in VBE and mine all 86 properties
of the Win32_Printer WMI object.

You'll need API programming to set them with code.
Certainly if it concerns some special manufacturers properties,
this aint going to be easy.

If you find the proper property's ID with the WMI script
let me know. Maybe I can help.

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


michelxld wrote in
<news:<michelxld.23a251_1140018302.9229@excelfor um-nospam.com


Hello

if WindowsXP is installed you may use


Sub proprietesImprimantes()
'
'http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmis
dk/wmi/win32_printerconfiguration.asp '
Dim objWMIService As Object, colItems As Object
Dim objItem As Object
Dim strComputer As String
Dim i As Byte

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2")