I have a file in html that I need to open and print.
It doesn't print and it doesn't show the print dialog.
Is the problem likely to be related to the fact that I never
actually display the browser control on the screen?
I kinda want this to be done behind the scenes.
It gets the path and converts it correctly, (i.e. c://thisfolder becomes c:/thisfolder like it should)
Code:public void PrintFile() { //Create a new IE control System.Windows.Forms.WebBrowser myBrowser = new System.Windows.Forms.WebBrowser(); //Load it with file Uri myURL = new Uri(GetDefaultPath() + "PrintThisFile.html"); myBrowser.Navigate(myURL); myBrowser.Refresh(); //Print it myBrowser.ShowPrintPreviewDialog(); myBrowser.Print(); //close and clean up myBrowser.Dispose(); }//PrintFile()




Reply With Quote