Printing xml
-
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
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)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)