Export (0) Print
Expand All

IShellDispatch2.FindPrinter method

Displays the Find Printer dialog box.

Syntax


iRetVal = IShellDispatch2.FindPrinter(
  [ sName ],
  [ sLocation ],
  [ sModel ]
)

Parameters

sName [in, optional]

Type: BSTR

A String that contains the printer name.

sLocation [in, optional]

Type: BSTR

A String that contains the printer location.

sModel [in, optional]

Type: BSTR

A String that contains the printer model.

Remarks

This method is implemented and accessed through the Shell.FindPrinter method.

If you assign strings to one or more of the optional parameters, they are displayed as default values in the associated edit control when the Find Printer dialog box is displayed. The user can either accept or override these values. If no value is assigned to a parameter, the associated edit box is empty and the user must enter a value.

This method is not currently available in Microsoft Visual Basic.

Examples

The following examples show the use of FindPrinter to display the Find Printer dialog box for a particular application. Usage is shown for JScript, VBScript, and Visual Basic.

JScript:


<script language="JScript">
    function fnFindPrinterJ()
    {
        var objShell = new ActiveXObject("shell.application");
        
        objShell.FindPrinter();
    }
</script>


VBScript:


<script language="VBScript">
    function fnFindPrinterVB()
        dim objShell
        dim bReturn

        set objShell = CreateObject("shell.application")
        objShell.FindPrinter()

        set objShell = nothing
    end function
</script>


Requirements

Minimum supported client

Windows 2000 Professional, Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Shldisp.h

IDL

Shldisp.idl

DLL

Shell32.dll (version 5.0 or later)

 

 

Community Additions

ADD
Show:
© 2014 Microsoft