?
Solved

creating an HTML document inside the web browser control

Posted on 2000-04-25
5
Medium Priority
?
258 Views
Last Modified: 2013-12-26
I am creating an html document inside a web browser control, as shown in the msdn article "Handling Events in Visual Basic Applications"

The point in the example where they create a document is like this
---------------------------------------
'Create an HTML document inside the WebBrowser control
    Dim sHTML
    sHTML = "<P>This is some text.</P>"
    sHTML = sHTML & "<P>And here is a button.</P>"
    sHTML = sHTML & "<BUTTON ID=btnMyButton>"
    sHTML = sHTML & "Click this button.</BUTTON>"
 
    wbMyBrowser.Document.body.innerHTML = sHTML  
 
'Instantiate new member of class
    Set cfForward = New clsForward  
    cfForward.Set_Destination Me, "Some_Procedure"
    Set wbMyBrowser.Document.All("btnMyButton").onclick = cfForward

End Sub
------------------------------------


What I CAN'T find is how to create the header portion of my html document, where I can put a couple VBScript functions that I need to process the information entered into my web page.

I am looking at the WebBrowser Object and Document Object in msdn, and see no reference to the html header.

I'm sure it's there, I just don't see it %)

thanks in advance

Jim
0
Comment
Question by:jnearing
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 12

Expert Comment

by:mark2150
ID: 2751696
is there not a head property under wbMyBrowser.Document?

M
0
 
LVL 1

Author Comment

by:jnearing
ID: 2751705
I'm looking the documentation now for the WebBrowser object and the document.

There's nothing that shows a header object or property.

Maybe there is some other functionality to adding a VBScript function to a web page.   I might be approaching it the wrong way.

thanks

Jim

0
 
LVL 12

Accepted Solution

by:
mark2150 earned 800 total points
ID: 2751742
Usually I *CHEAT* and just write the HTML to disk and then point the browser control to that file. It's a little slower (but not much) and I get complete control without having to fiddle with poorly documented features.

M
0
 
LVL 1

Author Comment

by:jnearing
ID: 2751802

I initially did it that way, and had it all working, as long as I had a break point in the code after writing the file to disk.

I create an instance of a class with a method that detects when the button on the html form is clicked.

I find that without the breakpoint after the html file is written to disk, the method doesn't fire, or an object that is to be created isn't there.

I'm thinking it must be a timing issue of having the disk file created.

Creating the page in memory should be faster and cleaner.

I may have to put a wait in there to allow an html file on disk to be created before the other stuff happens.

I am more of a C programmer than VB, so I am floundering a little with this.

thanks
0
 
LVL 1

Author Comment

by:jnearing
ID: 2752323
I went back to writing the file out to disk each time.

Found a property of the WebBrowser control called readystate that I can test, and wait until it returns ready.

Then it successfully create the instance of the class and goes on.

thanks
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question