473,385 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Webbrowser and HTML documents

Does anybody know if it's possible to use the Webbrowser control to render a
given HTML text?

What I'm looking for is something like this:

WebBrowser1.Document.Body.OuterHTML = "<b>TEST</b>"

and then I want to see TEST in bold in the webbrowser.

Is that possible?

Cheers,
Johnny J.
Jun 19 '07 #1
4 2054
Tom
That should work, try using INNERHTML instead of OuterHTML...

Johnny Jörgensen wrote:
Does anybody know if it's possible to use the Webbrowser control to render a
given HTML text?

What I'm looking for is something like this:

WebBrowser1.Document.Body.OuterHTML = "<b>TEST</b>"

and then I want to see TEST in bold in the webbrowser.

Is that possible?

Cheers,
Johnny J.

Jun 19 '07 #2
It doesn't - Because I haven't actually called the Webbrowser's Navigate
method, the document property is null. And I can't define an html document
object and assign to the webbrowser manually because the document property
is read-only.

The given code was just an example to give you an idea of what I wanted. I
think it takes some more magic to make it work, and I can't figure out how,
I'm afraid...

Cheers,
Johnny J.


"Tom" <to**********@gmail.comwrote in message
news:uA**************@TK2MSFTNGP03.phx.gbl...
That should work, try using INNERHTML instead of OuterHTML...
Johnny Jörgensen wrote:
>Does anybody know if it's possible to use the Webbrowser control to
render a given HTML text?

What I'm looking for is something like this:

WebBrowser1.Document.Body.OuterHTML = "<b>TEST</b>"

and then I want to see TEST in bold in the webbrowser.

Is that possible?

Cheers,
Johnny J.

Jun 19 '07 #3
Tom
Actually, you can pass HTML through the DocumentText property and it
will parse it.
Johnny Jörgensen wrote:
It doesn't - Because I haven't actually called the Webbrowser's Navigate
method, the document property is null. And I can't define an html document
object and assign to the webbrowser manually because the document property
is read-only.

The given code was just an example to give you an idea of what I wanted. I
think it takes some more magic to make it work, and I can't figure out how,
I'm afraid...

Cheers,
Johnny J.


"Tom" <to**********@gmail.comwrote in message
news:uA**************@TK2MSFTNGP03.phx.gbl...
>That should work, try using INNERHTML instead of OuterHTML...
Johnny Jörgensen wrote:
>>Does anybody know if it's possible to use the Webbrowser control to
render a given HTML text?

What I'm looking for is something like this:

WebBrowser1.Document.Body.OuterHTML = "<b>TEST</b>"

and then I want to see TEST in bold in the webbrowser.

Is that possible?

Cheers,
Johnny J.

Jun 19 '07 #4
Thanks a million, Tom - That seemed to do the trick. I guess I was looking
for a complicated solution when a simple one was right in front of my
eyes... :-)

Cheers,
Johnny J.

"Tom" <to**********@gmail.comwrote in message
news:%2******************@TK2MSFTNGP06.phx.gbl...
Actually, you can pass HTML through the DocumentText property and it will
parse it.
Johnny Jörgensen wrote:
>It doesn't - Because I haven't actually called the Webbrowser's Navigate
method, the document property is null. And I can't define an html
document object and assign to the webbrowser manually because the
document property is read-only.

The given code was just an example to give you an idea of what I wanted.
I think it takes some more magic to make it work, and I can't figure out
how, I'm afraid...

Cheers,
Johnny J.


"Tom" <to**********@gmail.comwrote in message
news:uA**************@TK2MSFTNGP03.phx.gbl...
>>That should work, try using INNERHTML instead of OuterHTML...
Johnny Jörgensen wrote:
Does anybody know if it's possible to use the Webbrowser control to
render a given HTML text?

What I'm looking for is something like this:

WebBrowser1.Document.Body.OuterHTML = "<b>TEST</b>"

and then I want to see TEST in bold in the webbrowser.

Is that possible?

Cheers,
Johnny J.
Jun 20 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kevin | last post by:
Hi, My application is a MDI and for each document, I create a WebBrowser control and call Navigate2 to get the HTML view of each document. I have tried opened two documents and Navigate2 to...
0
by: Carl Manson | last post by:
Hi All, I am writing a complex print job solution that requires the printing of many HTML documents in an exactly defined order. Our application uses the IE WebBrowser control to render the...
4
by: Toma Marinov | last post by:
Hello ! I made some test with webbrowser control in VS.2005. When I load a word document in webbrowser through .Navigate method (from my hdd), I want to get the stream of the loaded doc file with...
12
by: Alex Clark | last post by:
Greetings, (.NET 2.0, WinXP Pro/Server 2003, IE6 with latest service packs). I've decided to take advantage of the layout characteristics of HTML documents to simplify my printing tasks, but...
10
by: Nick | last post by:
Hi there, I'm having great difficulty obtaining all of the document data for a framed HTML document. Once the documentcomplete event has fired for the last time I am analysing the webbrowsers...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
1
by: David Veeneman | last post by:
I'm writing an application that will manage a database of documents typed into the application by the user. Some documents will contain links to other documents. If the user clicks on a link, the...
0
by: ranjanmondal | last post by:
I can access ( read/put ) value into the textbox of an html through webbrowser control in vb ( using document.getElementById("elementName"). But some time I notice that the element(textbox) in...
0
by: =?Utf-8?B?Q29kZVJhem9y?= | last post by:
Hi, Is it possible to access an htc file from the windows webbrowser control? I am receiving the following error: "An error has occurred in the script on this page." "Error: Access is denied...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.