Solved

Method of viewing HTML from a variable

Posted on 2004-04-20
2
168 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

740 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