arvindb1
asked on
Print HTML documents from VB.NET Windows application
Hi
Can somebody pls. tell me how to print HTML documents from VB.NET Windows application WITHOUT GETTING PRINT DIALOG BOX .
I have two problems
One is how to read HTML document using VB.NET windows application i.e. if i want to read value from an Input Text box from an HTML document then how to read it
Secondly how to print html docs without getting print dialog box control, basically i'm using WebBrowser control to load and view but i want to know hot to read and print.
I tried with Window.Print in this but it always gives me Print dialog box.
Pls. Help
Arvind
Can somebody pls. tell me how to print HTML documents from VB.NET Windows application WITHOUT GETTING PRINT DIALOG BOX .
I have two problems
One is how to read HTML document using VB.NET windows application i.e. if i want to read value from an Input Text box from an HTML document then how to read it
Secondly how to print html docs without getting print dialog box control, basically i'm using WebBrowser control to load and view but i want to know hot to read and print.
I tried with Window.Print in this but it always gives me Print dialog box.
Pls. Help
Arvind
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I tried first one with WebBrowser also but it gives error Object Reference not set to an instance of an object at Dim textstr As String = doc.all.txtfirst.value
Second problem i got some solution like this
AxWebBrowser1.Navigate("F: \Help\test winapp\tes t\abc.htm" )
While AxWebBrowser1.QueryStatusW B(SHDocVw. OLECMDID.O LECMDID_PR INT) <> SHDocVw.OLECMDF.OLECMDF_SU PPORTED + SHDocVw.OLECMDF.OLECMDF_EN ABLED
Application.DoEvents()
End While
AxWebBrowser1.ExecWB(SHDoc Vw.OLECMDI D.OLECMDID _PRINT, SHDocVw.OLECMDEXECOPT.OLEC MDEXECOPT_ DONTPROMPT USER)
then i'm able to print without prompt.
but first problem still remains.
Thanks a lot
Arvind
Second problem i got some solution like this
AxWebBrowser1.Navigate("F:
While AxWebBrowser1.QueryStatusW
Application.DoEvents()
End While
AxWebBrowser1.ExecWB(SHDoc
then i'm able to print without prompt.
but first problem still remains.
Thanks a lot
Arvind
ASKER
Hi Testn
Now the problem in printing is that if i put this into loop and try to print many html documents then i'm able to print only one document and rest all prints gets abondoned, any way to control this??
Second problem still remains, i'm not able to read values from html after loading.
Pls. help
Arvind
Now the problem in printing is that if i put this into loop and try to print many html documents then i'm able to print only one document and rest all prints gets abondoned, any way to control this??
Second problem still remains, i'm not able to read values from html after loading.
Pls. help
Arvind
ASKER
Hi Testn
Points are all yours if you just help me in this.
I want to read a preformatted mail (you can even suggest what format shall i use), currently i'm thinking about HTML format which has got some fields filled up and i want to read this mail programmatically and fetch the values from different fields and enter into the database. I'll accept any possible solution which can solve this problem.
Actually the flow is -- i will send a formatted mail to users who will fill up the fields in the mail itself while replying and then i have to fetch those values from mail and update the database.
Pls. suggest, how to acheive this minimizing the possibility of errors.
Thanks
Arvind Bansal
Points are all yours if you just help me in this.
I want to read a preformatted mail (you can even suggest what format shall i use), currently i'm thinking about HTML format which has got some fields filled up and i want to read this mail programmatically and fetch the values from different fields and enter into the database. I'll accept any possible solution which can solve this problem.
Actually the flow is -- i will send a formatted mail to users who will fill up the fields in the mail itself while replying and then i have to fetch those values from mail and update the database.
Pls. suggest, how to acheive this minimizing the possibility of errors.
Thanks
Arvind Bansal
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi testn
i tried that but it still prints one page only, anyway other part is OK.
Thanks for your help. I'm awarding you the points as i dont see any more comments coming out to solve this. Anyway thanks a lot.
Arvind
i tried that but it still prints one page only, anyway other part is OK.
Thanks for your help. I'm awarding you the points as i dont see any more comments coming out to solve this. Anyway thanks a lot.
Arvind
ASKER
Dim doc As New mshtml.HTMLDocument
doc.open("f:\temp\abc.htm"
Dim textstr As String = doc.all.txtfirst.value
But gets the error-- couldnt find element (txtfirst is a textbox in my htm file)
Is this the way to load document without using Webbrowser, i need to load htmldocument to read without using webbrowser
2. I used it using WebBrowser only and gets this error--- trying to revoke a drop target that has not been registered.
Arvind