Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
IE
ie55.activexcontrol
ie55.add_ons
ie55.browser
ie55.com.codedownload
ie55.css
ie55.databinding
ie55.dhtml
ie55.dhtml.authoring
ie55.dhtml.behaviors
ie55.dhtml.scripting
ie55.icw
ie55.misc
ie55.multimedia
ie55.oe.stationery
ie55.outlookexpress
ie55.programming
ie55.setup
ie55.webbrowser_ctl
ie6.browser
ie6.ieak
ie6.oe.wishlist
ie6.setup
ie6_oe.stationery
ie6_outlookexpress
  
 
date: Mon, 15 May 2006 14:50:52 -0400,    group: microsoft.public.windows.inetexplorer.ie55.programming.webbrowser_ctl        back       


Assign Printer device for IE control printing   
Good Day Everyone,

Can someone suggest a reliable way to let IE know which printer to use when 
printing with the control through VB6?
I am doing a workaround to manipulate the system default printer so that IE 
will use the printer we want (see code below).  Unfortunately, in spite of 
it's elegance (NOT), this plan doesn't always work.  In testing, I can see 
that Windows has accepted my reassignment of the default printer, then IE 
goes ahead and prints to the used-to-be default printer.  You are my last 
hope before deploying a brand-X web browser control that can probably accept 
a printer name argument.  Any ideas will be well appreciated!  Thanks,
Walter
..
..
..
        Case "htm", "html"

            OldDefaultPrinterName = GetDefaultPrinterName
            SetDefaultPrinter PrinterName
            SomeForm.printIe FileName, Copies
            SetDefaultPrinter OldDefaultPrinterName
..
..
..



Sub printIe(ByVal FileName As String, ByVal Copies As Integer)
..
..
..
    Do While Copies > 0
        Copies = Copies - 1
        m_PrintedIeFile = False

        IeDoc.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, Empty, 
Empty

        MyUtilityLib.WaitNonBlocking 30, 50, m_PrintedIeFile

        If Not m_PrintedIeFile Then
            Err.Raise vbObjectError, "print " & FileName, "Timeout Printing 
File"
        End If
    Loop
date: Mon, 15 May 2006 14:50:52 -0400   author:   Walter Smerek

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us