LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to display a HTML String in a ActiveX WebBrowser ?

How to direct display a HTML String in a ActiveX WebBrowser without use a URL ?
0 Kudos
Message 1 of 8
(6,262 Views)
I am sure that it would depend on the browser, but with Internet Explorer from Microsoft, I don't think you can. (I may be wrong on this.) What you could do would be to save your string to file and read the file as a url in the browser. I know that this is a step you are trying to avoid, but it will work.

Hope that this helps,
Bob Young
Message 2 of 8
(6,262 Views)
Hi,

Bob, you are wrong, it is possible...

Use the Navigate2 method, and in the URL don't wire a path, but a string,
like this:

about:



The "about:" is the key, after this you can put your html.

Regards,

Wiebe.


"Bob Y." wrote in message
news:506500000005000000B0CF0100-1079395200000@exchange.ni.com...
> I am sure that it would depend on the browser, but with Internet
> Explorer from Microsoft, I don't think you can. (I may be wrong on
> this.) What you could do would be to save your string to file and
> read the file as a url in the browser. I know that this is a step you
> are trying to avoid, but it will work.
>
> Hope that this helps,
> Bob Young
Message 3 of 8
(6,263 Views)
Wiebe,
 
This is really slick, but it seems there is a limit (1k or so) to the length of the html string.
Are there any tricks to inputing a bigger string?
 
 
Thank you,
steve
----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 8
(6,023 Views)

Anyone know an answer to this yet?  This came up in a google search for me and fits my problem exactly.

0 Kudos
Message 5 of 8
(5,317 Views)

Are you stuck with ActiveX? 

 

I suggest you simply use the .NET WebBrowser control and its DocumentText property to display an HTML string.

0 Kudos
Message 6 of 8
(5,312 Views)

 

Nev mind- I found I can do this-

 

navigate2 "about: "

call doEvents

set document.body.innerHTML to my Html code.

 

I'm using microsoft access vba.  I didn't even know what language y'all were using  🙂

 

0 Kudos
Message 7 of 8
(5,310 Views)

Like this.

0 Kudos
Message 8 of 8
(5,303 Views)