locked
Displaying HTML string using WebBrowser Control in VB 6.0

    Question

  • Hello,
    I am trying to display the contents of a string containing HTML (the response from a web services call) in a webbrowser control.  Can anyone tell me how to do this?  I added the Component 'Microsoft Internet Controls' to the project.  I've seen posts saying that I need to set the 'DocumentText' property of this control, but there is no property by that name; I assume I'm using an older control because I am on VB 6.0.
    Thanks!
    Thursday, November 20, 2008 9:34 PM

Answers

  • Hi paul Thanks, by the way did you try write method, something like

    WebBrowser1.Navigate "about:blank"
    WebBrowser1.Document.open()
    WebBrowser1.Document.write("<HTML>....</HTML>")
    WebBrowser1.Document.Close()


    I was curious to know the result

    Thanks

    Arjun Paudel
    • Proposed as answer by konikula Saturday, November 22, 2008 11:11 PM
    • Marked as answer by Xingwei Hu Thursday, November 27, 2008 7:04 AM
    Friday, November 21, 2008 2:19 PM

All replies

  •  You could write your string into temp file and use navigate also.
    This contributor is MSDN testing bot, using BabelFish translator, passive NN "Thread integrator" and Google's VBCContextSearch api to help you resolving threads, if you want to improve it, just react to its posts. Your MSDN team :)
    • Proposed as answer by konikula Friday, November 21, 2008 12:53 PM
    Friday, November 21, 2008 2:51 AM
  • Yes temp file is the best way as far as I can remember my old days but have you tried, WebBrowser1.Document.Write(htmlstring), I am not sure, please check it once.

    One more think this forum does not discuss vb 6, would be better for you if you try some other forum for visual basic 6

    Read the following sticky, there are very good links for vb 6

    http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/6a0719fe-14af-47f7-9f51-a8ea2b9c8d6b

    Arjun Paudel
    • Proposed as answer by konikula Friday, November 21, 2008 1:03 PM
    Friday, November 21, 2008 12:48 PM
  • Arjun,
    Thanks very much for pointing me to the vb 6 links; I had not noticed that this forum was not for vb6.
    I was hoping to avoid using a temp file; I'll see if those links can be of any help.
    -Paul
    Friday, November 21, 2008 2:13 PM
  • Hi paul Thanks, by the way did you try write method, something like

    WebBrowser1.Navigate "about:blank"
    WebBrowser1.Document.open()
    WebBrowser1.Document.write("<HTML>....</HTML>")
    WebBrowser1.Document.Close()


    I was curious to know the result

    Thanks

    Arjun Paudel
    • Proposed as answer by konikula Saturday, November 22, 2008 11:11 PM
    • Marked as answer by Xingwei Hu Thursday, November 27, 2008 7:04 AM
    Friday, November 21, 2008 2:19 PM