Re: Webbrowser question
- From: Phil <phil@xxxxxxxxxx>
- Date: Sun, 02 Oct 2005 14:52:36 +0200
Thanks Norm,
I had this okay...I just had to wait until the browser is free and Ken suggested to test Webbrowser1.Busy. Yours goes in the same direction
Thanks to both of you guys...
Phil
Norm Cook a écrit :
Not an expert but, if you can string manipulate the file to get the header, text & footer, you may be able to adapt this to your needs:
Option Explicit Private HTMLHdr As String 'header Private HTMLTxt As String 'text Private HTMLFtr As String 'footer Private Sub Form_Load() 'simple html page HTMLHdr = "<html><head><Title>Doc Title</Title></head><body>" HTMLTxt = "<H1>Hello World</H1>" HTMLFtr = "</body></html>" WritePage End Sub Private Sub WritePage() With WebBrowser1 .Navigate "about:blank" 'new page Do While .ReadyState <> READYSTATE_COMPLETE DoEvents 'wait till done Loop '& write the html .Document.write HTMLHdr & HTMLTxt & HTMLFtr End With End Sub 'Insert the Textbox content Private Sub Command1_Click() HTMLTxt = HTMLTxt & "<H1>" & Text1.Text & "</H1>" WritePage End Sub 'Print the webpage Private Sub Command2_Click() WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER End Sub
"Phil" <phil@xxxxxxxxxxxxxxx> wrote in message news:433bebad$0$11157$626a14ce@xxxxxxxxxxxxxxx
Hello experts,
I have written an app which displays an HTML file in a Webbrowser. Under
the
Webbrowser in the form, I also have a textbox in which I expect the user
to
type in some comments. I then append these comments to the end of the HTML file, reload the file with Webbrowser.Refresh and send it for print with Webbrowser.execwb OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, Empty, Empty
All this works fine EXCEPT that if the comments are actually appended to
the
HTML file, the reload using Refresh does not fire up the NavigateComplete event and what I get on the printer is the file content BEFORE appending
the
comments to the end...
I could use a second Webbrowser and reload it again but I find it
weird...Am
I missing something or doing something wrong?
Thanks for your help
Phil
.
- References:
- Re: Webbrowser question
- From: Norm Cook
- Re: Webbrowser question
- Prev by Date: Re: Webbrowser question
- Next by Date: winsocket
- Previous by thread: Re: Webbrowser question
- Next by thread: Re: Webbrowser question
- Index(es):
Relevant Pages
|
Loading