473,395 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Control to preview HTML text

759 512MB
Hello !

I am looking for a control (if exist) to preview HTML file as this fil will appear in a internet browser.
The goal is to use Access database to store HTML tags/syntax then use this database to create HTML files.
So I like to have a small area in my form where to preview the web page.

I know that I can open the .html file in my browser and refresh from time to time the page, in order to see the results, but I think that is easier to see at any time, in my form, if the created HTML code work as I expect.

Thank you !

PS Access 2007
Mar 31 '12 #1

✓ answered by Stewart Ross

Hi Mihail. If you look at the ActiveX controls available from the forms design list you should be able to add a Microsoft Web Browser control to your form. You can set the browser to display the contents of an HTML file by using its Navigate method. For example, if the control was called WebBrowser and you place an HTML file called YourWebPage.html in the same folder as the database, you could navigate to it by placing the following line in your form's On Load event sub:

Expand|Select|Wrap|Line Numbers
  1. Me.WebBrowser.navigate CurrentProject.Path & "\YourWebPage.html"
-Stewart

6 16182
Stewart Ross
2,545 Expert Mod 2GB
Hi Mihail. If you look at the ActiveX controls available from the forms design list you should be able to add a Microsoft Web Browser control to your form. You can set the browser to display the contents of an HTML file by using its Navigate method. For example, if the control was called WebBrowser and you place an HTML file called YourWebPage.html in the same folder as the database, you could navigate to it by placing the following line in your form's On Load event sub:

Expand|Select|Wrap|Line Numbers
  1. Me.WebBrowser.navigate CurrentProject.Path & "\YourWebPage.html"
-Stewart
Apr 1 '12 #2
NeoPa
32,556 Expert Mod 16PB
There is no way for HTML to be previewed except via a link of some kind. You cannot formulate a string, as you can for SQL for instance, and then pass that string to a browser control, if that was what you were wondering.

As long as it's saved somewhere first though, Stewart's post tells you how to preview it.
Apr 1 '12 #3
Mihail
759 512MB
Thank you for replies.
I can not find this control (Microsoft Web Browser) or something similar in Access 2007.
I see this control in Excel 2007, in Word 2007 (I play a little bit with it in this applications) but not in Access 2007.
Is nowhere. :(
Apr 1 '12 #4
Stewart Ross
2,545 Expert Mod 2GB
Can't think why it does not appear in your list of ActiveX controls in Design view, Mihail. It appears in my A2007 installation, and also in a separate laptop installation of A2010 I use.

If the ActiveX control itself is not registered for A2007 you can try registering it by following the advice in this knowledgebase article. I can't test this as mine is already registered correctly.

The DLL file involved is C:\Windows\SysWOW64\ieframe.dll

-Stewart
Apr 1 '12 #5
Mihail
759 512MB
Thank you very much, Stewart !

I test the advices from your link and it works.
For Windows XP/32 bytes the involved file is
Expand|Select|Wrap|Line Numbers
  1. C:\WINDOWS\system32\shdocvw.dll
More one thing for every one who read this thread (because I have wasted a lot of time because I have not know where to look for ActiveX controls which are not in the ribbon):

In Form Design View, under tab Design, in Controls area it is a button Insert ActiveX Control.
Apr 1 '12 #6
Mihail
759 512MB
This code will preview an HTML string into a Microsoft WebBrowser Control

Expand|Select|Wrap|Line Numbers
  1. Dim HTML As String
  2.     HTML = "<HTML>"
  3.         HTML = HTML & "<p> Preview my HTML string </p>"
  4.     HTML = HTML & "</HTML>"
  5.  
  6. Dim obj As HTMLDocument
  7.    Set obj = WebBrowserControlName.Document
  8.    obj.body.innerHTML = HTML
Apr 13 '12 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: bbxrider | last post by:
one of my fist asp pages i have vbscript rountines that are sending page text with response.write they are in the asp file before regular html text yet the html text appears first on the page???...
4
by: Ed West | last post by:
Hello Can I put generic HTML Text in a Placeholder, or does it need to be a server control? If I can't, how can I put dynamically put in some text in a template? ie, in the .ascx file ...
20
by: Guadala Harry | last post by:
In an ASCX, I have a Literal control into which I inject a at runtime. litInjectedContent.Text = dataClass.GetHTMLSnippetFromDB(someID); This works great as long as the contains just...
2
by: Frank Bishop | last post by:
I have a code snip from 4Guys that uses an html text box name property and I need to use a Web Form control instead. Since the Web Form control does not have the "name" property, how would I do...
2
by: Chad | last post by:
In our application, I would like to send out HTML mail. TO do so, I must do something like this: Mail.Body = <raw HTMLTEXT String> Hence, I would like to know how to get the HTML text for Web...
5
by: serge calderara | last post by:
Dear all, I am new in asp.net and prepare myself for exam I still have dificulties to understand the difference between server control and HTML control. Okey things whcih are clear are the fact...
4
by: sreejith.ram | last post by:
What is the difference/advantages/disadvantages of using Textbox Web Control over HTML Text Box with Run at Server? I could'nt figure out a convincing answer. I was testing it this morning.. I...
1
by: Ryan | last post by:
Hello, If I have an HTML text box that I want to manipulate with javascript, how can I access the value of the text box on postback server-side? Thanks, Ryan
2
by: Frank | last post by:
From: "Frank" <fkaesser@pfmail.com> Subject: Can I Use HTML Text Writer i a Custom Control to Render the <head> Section? Date: Wednesday, January 18, 2006 11:38 AM I would like to create a...
2
by: Sreenath Rao Nellutla | last post by:
Hai all, I am trying to create dropdown calendar control with HTML input control by writing JavaScript. But while executing I am getting the error as "Error on Page" on the status bar of the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.