Solved

Method of viewing HTML from a variable

Posted on 2004-04-20
2
171 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

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…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month4 days, 4 hours left to enroll

630 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