Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 11th, 2006, 02:36 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default View Text in HTML Format

Does anyone know if I can view text with the HTML markup displaying?

In other words. I have a textbox that contains text and HTML tags. I would like to see what the text would look like if it was in a browser. I have added a Web Browser control, but am not sure how to set the source to a field in my database.

Any ideas,

Thanks

Mike

Mike
EchoVue.com
__________________
Mike
EchoVue.com
 
Old February 13th, 2006, 01:47 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Well, I have a kludge you can use without the control.

Put a button on your form, then on the On Click event,

Capture the value in the text field, and then create an html file and drop it on the root drive C:

Then open internet explorer, and call the html file as your link.

When you want to look at the next value, overwrite the html file. SO this way you only have one html file on the root of C: at a time, and are not accumulating them.

On the Form's On Close event, you erase the file.

Something like this:
'Without the declarations
Const ForWriting = 2
stText = "<html><head><title>New Page 1</title></head><body>Hello World</body></html>"

stLink = "C:\CurrentRecord.txt"

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile(stLink) ' this will overwrite

Set objFile1 = objFSO.OpenTextFile(stLink, ForWriting)
objFile1.WriteLine stText

Set objExplorer = CreateObject("InternetExplorer.Application")
        objExplorer.Navigate stLink
        objExplorer.Visible = 1

This should work. It will open IE and show the contents of the file. I use IE and files to make Help systems for the apps I develop, but I usually make them in FrontPage. I will try this making pages on the fly (which some developers recommend.)

HTH


mmcdonal
 
Old February 13th, 2006, 01:55 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Thanks Mike,

That should work, I'll let you know how it goes.

Thanks

Mike

Mike
EchoVue.com
 
Old February 13th, 2006, 01:58 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I didn't have time to test it, and my filesystem permissions are giving me a headache (new network program). HTH

mmcdonal
 
Old February 13th, 2006, 02:00 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

I can't see any reason why it wouldn't work, and I got the idea to put the Browser Control in a window and so instead of opening up IE, I could just have a form popup, and make the source the file on the C:Drive.

Thanks again,

Mike

Mike
EchoVue.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent - Send mail with plain view and html view ashish.dadhwal ASP.NET 2.0 Professional 0 November 27th, 2008 01:49 AM
Convert Rich Text Format to Ordinary Format in ASP Andraw Classic ASP Basics 1 August 31st, 2007 10:05 AM
Datasheet view of a Query - Field Format arfa Access 4 March 13th, 2006 12:34 PM
datagrid view date format slyverson General .NET 2 December 3rd, 2005 10:52 AM
How can I view an XML doc to HTML format jolo98 XML 3 July 23rd, 2004 01:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.