Microsoft Access HTML Viewer

167 views
Skip to first unread message

JamieJamie

unread,
Jul 26, 2010, 12:07:37 PM7/26/10
to
I have a field of text written in html and stored in a memo field.
instead of displaying in a memo field, i would like to see it
presented as html (as you would in interent explorer)

is there any easy way of doing this?

thanks in advance for your help

David W. Fenton

unread,
Jul 26, 2010, 1:59:42 PM7/26/10
to
JamieJamie <jh...@onetel.com> wrote in
news:45b3d821-7372-4d0f...@f6g2000yqa.googlegroups.com
:

> I have a field of text written in html and stored in a memo field.
> instead of displaying in a memo field, i would like to see it
> presented as html (as you would in interent explorer)
>
> is there any easy way of doing this?

Depends on your version of Access. In A2010, the new rich-text
control makes this quite transparent. Before that you had to use the
non-native web browser control, which works fairly well but has some
quirks (and can only display a file from the file system, not an
arbitrary stream of HTML).

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Ron Weiner

unread,
Jul 26, 2010, 8:58:19 PM7/26/10
to
David W. Fenton formulated the question :

> JamieJamie <jh...@onetel.com> wrote in
> news:45b3d821-7372-4d0f...@f6g2000yqa.googlegroups.com
>>
>
>> I have a field of text written in html and stored in a memo field.
>> instead of displaying in a memo field, i would like to see it
>> presented as html (as you would in interent explorer)
>>
>> is there any easy way of doing this?
>
> Depends on your version of Access. In A2010, the new rich-text
> control makes this quite transparent. Before that you had to use the
> non-native web browser control, which works fairly well but has some
> quirks (and can only display a file from the file system, not an
> arbitrary stream of HTML).

While it is true that you can not bind a Web Browser control to an
Access data source as you can with a Rich Text control. You do not
HAVE to point the web Browser control to either a file on the disk or a
URL on the internet.

The Web Browser control CAN accept a stream of html in the
BeforeNavigate2 Event.

wb.Document.Open "text/html", "replace"
wb.Document.Write strHTML
wb.Document.Close

Been using this code for years in an old VB6 app that builds the string
strHTML above from data pulled out of an Access database.

Rdub


David W. Fenton

unread,
Jul 27, 2010, 8:24:58 PM7/27/10
to
Ron Weiner <No...@NoWare.NutThing> wrote in
news:i2lavo$lr8$1...@news.eternal-september.org:

> While it is true that you can not bind a Web Browser control to an
> Access data source as you can with a Rich Text control. You do
> not HAVE to point the web Browser control to either a file on the
> disk or a URL on the internet.
>
> The Web Browser control CAN accept a stream of html in the
> BeforeNavigate2 Event.
>
> wb.Document.Open "text/html", "replace"
> wb.Document.Write strHTML
> wb.Document.Close
>
> Been using this code for years in an old VB6 app that builds the
> string strHTML above from data pulled out of an Access database.

Damn. I didn't know that. I'll have to try it in the app of mine
that makes the most use of the web browser control (and writes to a
temp file).

You learn something new every day, and in this case, it's for
something I've been doing for better than half a decade!

Stuart McCall

unread,
Jul 27, 2010, 8:53:27 PM7/27/10
to
"Ron Weiner" <No...@NoWare.NutThing> wrote in message
news:i2lavo$lr8$1...@news.eternal-september.org...

I'd like to add my thanks to David's, and for much the same reason.


David W. Fenton

unread,
Jul 28, 2010, 2:18:42 PM7/28/10
to
"Stuart McCall" <smc...@myunrealbox.com> wrote in
news:icL3o.288384$tH4.170868@hurricane:

> I'd like to add my thanks to David's, and for much the same
> reason.

And silly me, I didn't even say thanks!

So, here it is:

Thanks very much, Ron, for pointing this out!

Ron Weiner

unread,
Jul 28, 2010, 8:15:19 PM7/28/10
to
David W. Fenton formulated on Wednesday :

Guys

Thanks is absolutely not necessary. I thought that this is what the
newsgroup was about. Hardly a week goes by that I am not learning and
pilfering code from another's post. Also you gotta' know I did not
invent this, I can't remember any of the details, but you can be sure,
I stole if from somewhere!

Rdub


v...@77shop.ru

unread,
Jan 30, 2013, 2:28:53 AM1/30/13
to
Can you share more code? I'm getting Document = Nothing in object passed to event, so Document.Open is not working.
Thanx

четверг, 29 июля 2010 г., 4:15:19 UTC+4 пользователь Ron Weiner написал:

flodmot...@gmail.com

unread,
Jan 14, 2014, 5:06:16 AM1/14/14
to

> The Web Browser control CAN accept a stream of html in the
> BeforeNavigate2 Event.
>
> wb.Document.Open "text/html", "replace"
> wb.Document.Write strHTML
> wb.Document.Close
>
> Been using this code for years in an old VB6 app that builds the string
> strHTML above from data pulled out of an Access database.
>
> Rdub

Perfect Rdub!
Reply all
Reply to author
Forward
0 new messages