finding printer resolution 
Author Message
 finding printer resolution

Does anyone how to find the brower's default printer resolution from my
client side VBScript? I need to know the resolution before I print the page.

Tom Andersen



Wed, 19 Nov 2003 06:12:30 GMT  
 finding printer resolution
hi Tom,

If you have wmi (a.k.a. Windows Management Instrumentation) installed, you
can get at your printer resolutions via a standalone script:

--- <snip> ---
' using wmi to get printer resolution,  02Jun01, jw

Option Explicit
'
Dim oWMI, Printer  ' as objects
Dim sPrnInfo  ' as string
Const prnDefaultFlag = &H4  ' flag bit 3

  Set oWMI = GetObject("winmgmts:")

  for each Printer in oWMI.InstancesOf("Win32_Printer")
    sPrnInfo = "Printer Name: " & vbTab & vbTab & Printer.Name & vbCrLf &
vbCrLf _
        & "HorizontalResolution: " & vbTab &
CStr(Printer.HorizontalResolution) & " pixels/inch" & vbCrLf _
        & "VerticalResolution:   " & vbTab &
CStr(Printer.VerticalResolution) & " pixels/inch"

    if  Printer.Attributes AND prnDefaultFlag  then _
        sPrnInfo = sPrnInfo & vbCrLf & vbCrLf & "This is the DEFAULT
printer"

    MsgBox(sPrnInfo)  ' show (hor/vert) resolution of this printer
  next  ' printer

Set oWMI = nothing  ' clean up
WScript.Quit
--- </snip> ---

Whether or not this works in an IE client script, I don't know...

cheers, jw


Quote:
> Does anyone how to find the brower's default printer resolution from my
> client side vbscript? I need to know the resolution before I print the
page.

> Tom Andersen



Thu, 20 Nov 2003 00:00:54 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ** Help with Finding Printer Resolution **

2. How To find the Printer resolution

3. How to find out resolution?

4. Can't find printer-name when using Printer-Dialog (commdlg)

5. Can't find printer-name when using printer-dialog (commdlg)

6. How do I find printer selected from the Printer Dialog Box

7. Pls help me understand printer resolutions...

8. Printer resolution

9. Printing with different printer resolutions?

10. Help please, on Printer Resolutions

11. Printer Y-resolution

12. Printer resolutions

 

 
Powered by phpBB® Forum Software