Re: Webbrowser question



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







.



Relevant Pages

  • Re: Playing AVI and MPEG using MCI
    ... "mciSendStringA" (ByVal lpstrCommand As String, ... Dim mlRet As Long ... Private Sub CenterObject ... If mlRet 0 Then ...
    (microsoft.public.vb.controls)
  • RE: Adding Bound Pictures to an Access Database
    ... when the student's picture is missing it is leaving the ... Private Sub Form_Current ... Dim strPath As String ... Private Function pfValidFile(aFile As String) As Boolean ...
    (microsoft.public.access.modulesdaovba)
  • RE: jpgs not showing on forms
    ... Rather than embed the pictures in the database store the paths to the JPEG ... Private Sub cmdAddImage_Click ... Dim strAdditionalTypes As String, strFileList As String ... Private Sub cmdDeleteImage_Click ...
    (microsoft.public.access.gettingstarted)
  • Re: how to digitally sign XML documents step by step
    ... Add an XML node. ... >Private strPath As String ... >'The ControlID for the first control you add will be 1. ... >Private Sub ISmartDocument_PopulateActiveXProps(ByVal ControlID As Long, ...
    (microsoft.public.word.vba.general)
  • Re: how to digitally sign XML documents step by step
    ... Private strPath As String ... 'The ControlID for the first control you add will be 1. ... Private Sub ISmartDocument_PopulateActiveXProps(ByVal ControlID As Long, ... Dim strImage As String ...
    (microsoft.public.word.vba.general)

Loading