Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. printing xml in ie

printing xml in ie

Scheduled Pinned Locked Moved Visual Basic
xmlcomhelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Stephen Lintott
    wrote on last edited by
    #1

    Hi. I'm busy with a app that needs to print xml rendered by xslt. Currently I am printing with internet explorer in the following manner <pre> 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) While webBrowser.Busy Threading.Thread.Sleep(500) End While 'Get access to the webbrowser's document. internetExplorer.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, noValue, noValue) 'CType(internetExplorer.Document, mshtml.IHTMLDocument2).close() Marshal.ReleaseComObject(internetExplorer) Marshal.ReleaseComObject(webBrowser) </pre> I need to find a different way to do this as the above code gives a com exception. Or I need a workaround for the above code. If anybody can help I would greatly appreaciate it. Stephen

    Stephen Lintott Bsc IT (RAU)

    D 1 Reply Last reply
    0
    • S Stephen Lintott

      Hi. I'm busy with a app that needs to print xml rendered by xslt. Currently I am printing with internet explorer in the following manner <pre> 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) While webBrowser.Busy Threading.Thread.Sleep(500) End While 'Get access to the webbrowser's document. internetExplorer.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, noValue, noValue) 'CType(internetExplorer.Document, mshtml.IHTMLDocument2).close() Marshal.ReleaseComObject(internetExplorer) Marshal.ReleaseComObject(webBrowser) </pre> I need to find a different way to do this as the above code gives a com exception. Or I need a workaround for the above code. If anybody can help I would greatly appreaciate it. Stephen

      Stephen Lintott Bsc IT (RAU)

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Don't repeat the same question again and again in the same day. You just posted this 7 hours ago and haven't waited long enough for a response. I just started playing around with your code, not 2 minutes ago and need time to look it the problem.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      S 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Don't repeat the same question again and again in the same day. You just posted this 7 hours ago and haven't waited long enough for a response. I just started playing around with your code, not 2 minutes ago and need time to look it the problem.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        S Offline
        S Offline
        Stephen Lintott
        wrote on last edited by
        #3

        Sorry I just under presure to get an answer for this. Any luck so far because I am stuck

        Stephen Lintott Bsc IT (RAU)

        D 1 Reply Last reply
        0
        • S Stephen Lintott

          Sorry I just under presure to get an answer for this. Any luck so far because I am stuck

          Stephen Lintott Bsc IT (RAU)

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Yeah, and I'm under pressure to test 96 applications by the end of this week... CodeProject is supported entirely by people who volunteer their time. We get around to answering questions as much as we can whenever we can, but on our own time. We don't get paid to do this.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups