Hello all,
I need help in trying to access a web page from a windows service. I've actually already built a windows application (vb.net) that does this using the AxSHDocVw.AxWebBrowser class. The code works perfectly in the windows application, but when I use the code in a windows service, the code doesn't work!
I'm assuming this is because somehow the AxWebBrowser needs a desktop context to interact with (e.g. AxWebBrowser.Navigate). I tried to use the option to "Allow service to interact with desktop", but that didn't seem to do anything!
What I ultimately want to do (as per the code below), is to be able to print an HTML document (that references data from an XML doc) on the server. This has to be done from a windows service, as users would never log on to the server to run the application.
Do you guys know how I can do this? I've been going crazy trying to find out the best way to do this, and would love to hear input from others.
Thanks again
kmsultan
AxWebBrowser.Navigate(strContractURL, Nothing, Nothing, Nothing, Nothing)
While Not (AxWebBrowser.ReadyState = SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE)
System.Windows.Forms.Application.DoEvents()
End While
AxWebBrowser.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRIN T, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER , Nothing, Nothing)