Microsoft Access HTML Viewer

J

JamieJamie

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
 
D

David W. Fenton

:
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).
 
R

Ron Weiner

David W. Fenton formulated the question :
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
 
D

David W. Fenton

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!
 
S

Stuart McCall

Ron Weiner said:
David W. Fenton formulated the question :

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

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

David W. Fenton

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!
 
R

Ron Weiner

David W. Fenton formulated on Wednesday :
And silly me, I didn't even say thanks!

So, here it is:

Thanks very much, Ron, for pointing this out!

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

vn

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 напиÑал:
 
F

flodmotorgrodan

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top