469,362 Members | 2,427 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,362 developers. It's quick & easy.

Accessing IE DOM using VB6- alternatives to web browser control?

Hello:

I'm using VB6 in VS enterprise. I'd like to place an HTML form inside
a VB container, have a user fill out the form information, click a
submit button, and then have the program capture the field values and
write them to an ASCII file on the hard drive. Can anyone confirm that
this is even possible? I have dredged up one article "Accessing the
Internet Explorer Document Object Model from Visual Basic 5.0" (Asmi,
1998) that covers the basics, but doesn't provide the details I need.
Documentation on the Web Browser Control is virtually non-existent (I
have seen MSDN's documentation). I've searched the net and can't find
examples from people that have tried this. I have no trouble creating
a form with a web browser control and having it navigate to my HTML
template, but accessing the DOM with VB6 in the control is another
matter- some code samples would be great, if anyone can point me to
them....

I'm open to alternative ways to do this. I can't use .NET or
VBScript/ASP in this situation. I also can't design the input form
without using HTML (ie. using VB's form controls instead)- too time
consuming- I have to create many of these forms. The article mentions
two other methods- 1. launching a separate instance of IE using
SHDocVw.InternetExplorer- apparently more events and methods are
exposed this way, but this is too messy for my application. 2.
embedding an ActiveX control inside an IE HTML page- I suppose this is
acceptable. Thoughts on this?

Thanks,

Tom Meuzelaar
RockWare, Inc.
Jul 17 '05 #1
3 14723
On 23 Jul 2003 09:06:27 -0700, to*@rockware.com (Tom Meuzelaar) wrote:
I believe I said the opposite- designing VB forms is much more time
consuming than designing HTML forms.


Why ?

Why does writing VB take you more time than writing HTML ?

- is somebody else writing the HTML ?

Have you ever tried designing VB Forms 'on the fly' ?
Jul 17 '05 #2
On 23 Jul 2003 15:55:32 -0700, to*@rockware.com (Tom Meuzelaar) wrote:
Many reasons- the 2 primary ones:

1. yes, non-developers need to be able to design the forms.
2. the forms are government forms, some of them contain literally
hundreds of input fields- regardless of the development time, HTML
provides a more user-friendly interface. The long term idea is to
web-enable these forms, meaning they will all eventually need to be in
HTML.


Fair enough - it might be an idea to Web Enable the thing from the
very beginning

Installing a little WebServer on your machine - or preferably on
another machine on the network - would do the trick.

There is something called: WebSite1 written by O'Reilly
( it is probably up to WebSite99 by now )

The early versions used to be free
- I've found it very handy
- Oddly enough I have a copy of it at:
www.iss.u-net.com/website1.zip (all lower case)

it is about 4mb .... I really should do some housekeeping
Jul 17 '05 #3
Thank you Geoff- that information will take me quite a bit further
than where I was. I appreciate the example code.

Regards,

Tom

Cr********@hotmail.com (Geoff) wrote in message news:<79**************************@posting.google. com>...
to*@rockware.com (Tom Meuzelaar) wrote in message news:<82*************************@posting.google.c om>...
Many reasons- the 2 primary ones:

1. yes, non-developers need to be able to design the forms.
2. the forms are government forms, some of them contain literally
hundreds of input fields- regardless of the development time, HTML
provides a more user-friendly interface. The long term idea is to
web-enable these forms, meaning they will all eventually need to be in
HTML.

I find creating forms much easier in VB
the government needs to change there ways.

You will need to reference the MS HTML object Libary for your
events armed with that, DOM reference, WB control and
object browser you sould be away.

Dim WithEvents mydoc As HTMLDocument
Dim WithEvents docsform As HTMLFormElement
Private Sub Form_Load()
WB1.Navigate2 "C:\Government\cashback.htm"
End Sub
Private Sub Form_Resize()
WB1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
End Sub
Private Sub WB1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
With WB1
Set mydoc = .Document
Set docsform = .Document.Forms(0) 'Zero based
End With
End Sub
Private Function docsform_onsubmit() As Boolean
'Do your stuff
'You can stop the browser
' from doing anything with the event by returning false
docsform_onsubmit = False
End Function
doc refs normaly set to nothing in the before navigateto event
HTH
Geoff
--

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Paul Phillips | last post: by
6 posts views Thread by Andy Barber | last post: by
1 post views Thread by jimfollett1 via DotNetMonster.com | last post: by
reply views Thread by RSH | last post: by
reply views Thread by Tobester | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.