locked
printing RRS feed

  • Question

  • Hi I am currently working on a app that prints a html invoice using Internet Explorer. as follows

    Dim internetExplorer As New SHDocVw.InternetExplorerClass()
    Dim webBrowser As SHDocVw.IWebBrowser2 = CType(internetExplorer, SHDocVw.IWebBrowser2)
    '// Make the web browser visible. //
    webBrowser.Visible = False
    '// Display empty page so we have something to manipulate.
    Dim noValue As Object = System.Reflection.Missing.Value
    webBrowser.Navigate("file://" + fileName, noValue, noValue, noValue, noValue)
    Threading.Thread.Sleep(1000)
    '// Get access to the webbrowser's document.
    Dim htmlDoc As mshtml.IHTMLDocument2 = internetExplorer.Document
    Dim o As Object = ""

    htmlDoc.execCommand("Print", False, o)
    htmlDoc.close()

    I read in the documentation that one can set a value for nCmdExecOpt to OLECMDEXECOPT_DONTPROMPTUSER for the dialog. I just can't seem to figure out where to set it. All help greatly appreaciated. Tx 

    Tuesday, January 27, 2009 9:43 AM

Answers

  •  

    Hello Stephen, 

     

    Thank you for your post!  I would suggest posting your question in one of the 

    MSDN > Forums Home > Internet Explorer Development > Internet Explorer Web Development

     located here:  http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/threads/.

    Have a great day!


    Sudarshan shindode Tier 2 Application Support Server and Tools Online Engineering Live Services Team
    • Proposed as answer by sudarshans1 Friday, January 30, 2009 7:53 AM
    • Marked as answer by sudarshans1 Monday, March 23, 2009 10:46 AM
    Friday, January 30, 2009 7:53 AM