Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The Open method enables an ASP Web page to open access to a printer.
Syntax
HRESULT Open(
[in] BSTR bstrPrinterName
);
Parameters
bstrPrinterName [in]
Caller-supplied pointer to a string containing a printer name.
Return value
Win32 error codes can also be returned.
Return code | Description |
---|---|
S_OK | The operation succeeded. |
ERROR_INVALID_PRINTER_NAME | Invalid printer name. |
ERROR_NOT_ENOUGH_MEMORY | Out of memory. |
VBScript Example
This method obtains access to the specified printer by calling the print spooler's OpenPrinter function. For more information about this function, see the Windows SDK Documentation.
After the Iasphelp::Open call, the printer remains open until the Iasphelp::Close method is called, or until Iasphelp::Open is called again with a different printer name.
Dim objPrinter
strPrinter = Session("MS_printer")
Set objPrinter = Server.CreateObject ("OlePrn.AspHelp")
objPrinter.Open strPrinter
Requirements
Target platform: Desktop