Solved

Method of viewing HTML from a variable

Posted on 2004-04-20
2
164 Views
Last Modified: 2010-05-02
Hi,
I have a variable containing HTML and I want to be able to display it to the user in an html viewer of some sort (ie not see the source, see the correctly formatted HTML) but WITHOUT writing it to a file first.

is this possible? how do i do it?

The writing it to a file method works ok but i have a requirement not to do that if at all possible.
0
Comment
Question by:mwoolger
2 Comments
 
LVL 8

Expert Comment

by:fozylet
ID: 10869039
IE used to allow this when you set the URL to "about:" & your_html_formatted_string in previous versions.
The IE6 am having do not allow this though.

So if you can get hold of an older version of IE control, this can be done.
0
 
LVL 17

Accepted Solution

by:
zzzzzooc earned 125 total points
ID: 10885686
You can use the WebBrowser control to render HTML. The below modifies the innerHTML of Body which modifies everything within <body></body>..

For the below, add WebBrowser1 (Project -> Components -> Microsoft Internet Controls)

Form1:
------------

Private Sub Form_Load()
    Dim sHTML As String
    sHTML = "<a href='http://www.yahoo.com'>yahoo</a>"
    'Create document based on "about:blank"
    WebBrowser1.Navigate "about:blank"
    Do Until WebBrowser1.ReadyState = READYSTATE_COMPLETE
        DoEvents
    Loop
    'Assign HTML within <body></body>
    WebBrowser1.Document.body.innerHTML = sHTML
End Sub



0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now