Link to home
Start Free TrialLog in
Avatar of pcalabria
pcalabriaFlag for United States of America

asked on

Need code to Open a BROWSER and view an HTML file

Hello!

I have a query that displays a column called description that includes html text.
Is there a way that I can view the code using a browser by clicking on the specific cell that I want to view?

I read an older message board posting from one user who said there is a way to do this using an OLE Object type of table cell.  I've also wondered whether I might use the hyperlink cell type.

If this is not possible, I have already written code to save a file on the disk at C:\mytempfolder\exportfile.html and can get by if I get code to open the file with a browser.

Your help is always appreciated

'm using MS Access 2000, XP Pro
Avatar of PatHartman
PatHartman
Flag of United States of America image

I don't use the hyperlink data type, mostly because it isn't supported by SQL Server.  I just use a text data type and set the FormatAsHyperlink property to always.  Then in the click or dbl-click event, use the FollowHyperlink Method to open the document.  This will open whatever app is set as the Windows default for this particular file extension.  If the default doesn't work for you, you can use Shell but you will need to know what application you want to open and where it is so this method can cause issues if your users don't have consistent software and install locations.  So start with the FollowHyperlink because it relies on defaults.
Avatar of pcalabria

ASKER

Perhaps you can explain a bit further...

I currently have a column called Description in a query that contains HTLM code.

Is FormatAsHyperlink a property of the query?  If so, where is it and is it supported in Access 2k?

Also, what do mean by FollowAsHyprelink method?  I've used that before to link to urls, will it work for a file on my hard drive?
ASKER CERTIFIED SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks!  Works great!