0

Does anyone know how to programically create an html document for an Access WebBrowser control?

For instance, in Access 2010, to browse to a webpage, say http://www.daniweb.com, then assuming you have a WebBrowser control named "webBrowser", then you would use the following:

Me.webBrowser.Object.Navigate "http://www.daniweb.com"

Now say, you want to dynamically (programically) create a web document that webBrowser would display, you would think that something such as the following would work:

Dim htmlCode As String
      htmlCode = "<HTML>" & _
            "<TITLE>Page On Load</TITLE>" & _
            "<BODY>" & _
            "<FONT COLOR = BLUE>" & _
            "This is a " & _
            "<FONT SIZE = 5>" & _
            "<B>" & _
            "programmatically " & _
            "</B>" & _
            "</FONT SIZE>" & _
            "made page" & _
            "</FONT>" & _
            "</BODY>" & _
            "</HTML>"

      Me.webBrowser.Object.Navigate htmlCode

However, this doesn't work, and instead, loads your default search engine with the html code as your search term.

It appears that previously, one would use the

WebBrowser1.Document.Write

method to write to the WebBrowser control, but this doesn't appear to work with Access 2010 as it doesn't recognize .Document or .Write.

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by stevempeterson
0

On another note, does anyone know what the document datatype is? For instance:

Dim doc as Document

I have attempted to use this, but I keep getting errors mentioning "with" and I have been having problems looking for documentation of this datatype.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.