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, then assuming you have a WebBrowser control named "webBrowser", then you would use the following:

Me.webBrowser.Object.Navigate ""

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>" & _

      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


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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.