Web browser control and form fields

I would like to be able to access and alter the contents of HTML form fields in the web browser control. I would also like to be able to react to the user clicking on a form field.
It is for a custom IE5 in which the users will not have access to a keyboard. I will hopefully be providing a clickable vb keyboard, activated when a form field is clicked on, and then will copy the keys to the appropriate form field.
I can click on a submit button with VB, but have not found any way of changing the contents of a page or HTML of a page, short of modifying and reloading the whole page - which I don't want to do.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
I don't know much about it but isn't it what DHTML is supposed to do?
I would think that you would have a separate entry field along the top or bottom. You fill it with your virtual keystrokes and then have them click on a VB button [Send]. You then send the string to the server as a CGI script so that VB is doing the work and not the HTML.

You might be able to send a message to the web control every time the user clicks on the virtual keyboard.

Sounds cumbersome in either case.

Have done this in the past but stopped using it because it was to difficult to get 100% correct. Frames were killing the system.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

MikeThelwallAuthor Commented:
Thanks for the comments. I cant do anything to the web pages because this has to work for a set of web pages that I do not have control over - not the whole Internet but a couple of thousand pages on a few different sites.

Mirkwood, I would love to see how you did it. I might be able to live with a system that occasionally crashed if that is the best that is possible.
I want to get this straight ... do you just need to fill information into input boxes on the HTML form?

If that's the case, I'll post some code for you, its really not tough code, just tough to find the docs for how to do it!
MikeThelwallAuthor Commented:
Yes - I will launch IE5 through the web browser control and allow the user to browse (a section of) the Internet at will by clicking on links. When they want to fill in a form I need to be able to intercept the click on the form and launch a clickable VB keyboard so they can enter information with this. I need to be able to copy the keys they type with the keyboard into the form field.

So I need to intercept a click on a form and fill in information directly into the boxes.
The following code is a sample that will find and fill in inputboxes on an HTML page.

I'm guessing you're not having any trouble capturing the input from your keyboard substitute and building the strings. So there's your string to put in the inputbox.

However, I've no idea how to determine if a particular inputbox has the focus in the browser.

Private Sub FillHTMLInputBoxes(HTMLDoc As HTMLDocument)
    On Error GoTo handleError
    If HTMLDoc Is Nothing Then
        ' Not an HTLM document
        Exit Sub
    End If
    Dim BODYElement As IHTMLElement
    Set BODYElement = HTMLDoc.body
    If BODYElement.tagName = "BODY" Then
        Dim ELEMENTCo As IHTMLElementCollection
        Set ELEMENTCo = HTMLDoc.All
        Dim Element As HTMLAnchorElement
        For Each Element In ELEMENTCo
            If Element.tagName = "INPUT" Then
                b = Element.outerHTML
'                If InStr(b, "userid") And ReviewClicked = False Then
                If InStr(b, "userid") Then
                   Element.innerText = MyUserID
                End If
                If InStr(b, "pass") Then
                   Element.innerText = MyPassword
                End If
            End If
    End If

    Exit Sub

        MsgBox (Err.Description)

End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MikeThelwallAuthor Commented:
Brilliant, thanks!!!. - I'd tried outerHTML but it seemed  to  be read only. I didn't think of trying innerHTML in this way.
It took me a lot of trial and error to get it myself! LOL
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.