Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Method of viewing HTML from a variable

Posted on 2004-04-20
2
Medium Priority
?
172 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 500 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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 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…
Suggested Courses

715 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