Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dinamicly displaying .html to webbrowser control ?

Status
Not open for further replies.

100jan

Programmer
Aug 5, 2001
3
YU
Hi,
I am developing an application that uses Webbrowser control to load an encrypted html document from CD and decrypt it Befornavigate2, than to display decrypted content. Problem is it do not loads external .js (javasript) nor .css (style sheet) files and page looks cripled. Any help? I was using:

'1.
Text1.Text = Webbrowser1.Document.documentElement.innerText 'to read encrypted html file to an textbox
'2.
Dekriptovanje 'decripts textbox

'3. I used following to display content back to webbrowser control
Dim TestDoc As HTMLDocument
Set TestDoc = Webbrowser1.Document
TestDoc.body.innerHTML = Text1.Text
 
If I change
TestDoc.body.innerHTML = Text1.Text to
TestDoc.body.outerHTML = Text1.Text
it returns error '600'.

I guess problem is in passing html source from textbox to webbrowser control. What do you think? How do I pass all content from textbox to webbrowser correctly?

thanx.
 
I think you need to open the HTMLDocument and Write the new Html. I just have no idea what part of yor HTML has been encrypted and needs to be decrypted. Does the textbox look OK.
 
When I decrypt html it populates a Textbox with exact html source code that I need to display (everything from <html> to </html>). But I guess problem is in the way a pass this to webbrowser, since it doesn't load .js & .css from external files, but display normaly everything that is IN that html page.
Should
TestDoc.body.outerHTML = Text1.Text
pass everything from textbox to webbrowser ?

I'm trying to avoid writing to disk.
 
Make of this what you will.
Code:
On Error Resume Next
        Set objDoc = wbIntranet.Document.Open(&quot;text/html&quot;)
        objDoc.Write &quot;<HTML><HEAD><TITLE>Processing</TITLE><BODY>&quot;
        objDoc.Write &quot;Processing...Please wait.&quot;
        If Not f_objJYSCript.IsModule(strModuleName) Then
            objDoc.Write &quot;<BR>First access to the script - compiling it.<br>This takes about 25 seconds on a 100mz machine.&quot;
        End If
        objDoc.Write &quot;</BODY></HTML>&quot;
        objDoc.Close
        wbIntranet.Refresh
        
        DoEvents
        
    On Error GoTo 0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top