Well, see the subject.
I basically need the webbrowser to be able to navigate to a page, download it, have my program decrypt the page and display it.
Ideas, anyone?
Gerco.
Printable View
Well, see the subject.
I basically need the webbrowser to be able to navigate to a page, download it, have my program decrypt the page and display it.
Ideas, anyone?
Gerco.
do you need the .html source
webBrowser.document is the html sourse!!
Well, no.
When I do: msgbox Webbrowser1.document it just displays: [object]
And I need the source before the control displays it, then I need to change it and then the control must display it. The control won't recognise the file as HTML, because it needs to be decrypted first.
Gerco.
sorry try:
Webbrowser1.document.innerHtml
i think it's that
Gives me:Runtime error: 438: Object Doesn't support this property or methodCode:html = crypt(html, key)
WebBrowser1.Document.innerHtml = html
Gerco.
ohhhhhhhhhhhhhhhhh
you want to set the html in the webBrowser
i don't know how, i dunno if you can!!
sorry for the missunderstanding
In that case try this:
put your generated html in an .html file that you will
create, and then just point the webBrowser to this .html file,
how does this sound!!
Never mind..
I just want to give the webbrowser an url, it downloads the data, notifies me (by an event, already done), I decrypt the document, and give it to the webbrowser.
The webbrowser will then display the decrypted document.
Gerco.
It's actually this:
Code:Text1.Text = WebBrowser1.Document.documentElement.innerHTML
not sure what you mean with the decript part,but
you CAN'T set the webBrowser document(as far as i know)
try what i suggest:
I just want to give the webbrowser an url, it downloads the data, notifies me (by an event, already done), I decrypt the document
****************
put the decrypt document in a .html file that you will create
****************
, and give it to the webbrowser.
oh well,
maybe that what i'll do!!Quote:
Never mind..
Works kinda nice Matthew, but still some trouble:
The idea is: when the browser loads an URL with .gtw extension, it loads the file and decodes it, then points the webbrowser to the temp file.Code:Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
If Right$(UCase$(URL), 3) <> "GTW" Then Exit Sub
Dim urlToOpen As String
urlToOpen = URL
MsgBox "Decoding " & urlToOpen
b() = Inet1.OpenURL(urlToOpen, icByteArray)
For i = LBound(b) To UBound(b)
html = html & Chr$(b(i))
Next i
Open App.Path & "\tmp.html" For Output As 1
Print #1, crypt(html, key)
Close 1
WebBrowser1.Navigate2 App.Path & "\tmp.html"
Cancel = True
End Sub
The problem: when the webbrowser finishes loading the temp file, it continues to a navcancel page because of the cancel=true in the code.
And when I try and get the browser to download the file itself, it pops up a dialogbox asking me if I want to save the file, because it doesn't recognise the file format :-(
Ideas anyone?
Gerco.
I don't suppose this would work but have you tried cancelling first and then making the browser navigate to the temp file you decrypted?
You can set the html source code directly as shown below:
WebBrowser1.Navigate "about:<html>your text here
<img src='c:\Internet\somefile.gif'></img></body></html>"
You don't need to 'Navigate' to an external file.