473,387 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 15070
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paul Phillips | last post by:
Here is what I am trying to do. I have an application that is written in VB 6 and in this application it is accessing a custom dll file that was created using Microsoft Fortran Professional 4.0....
0
by: Mike | last post by:
Hello: I am trying to access a VB6 OCX file (with many important methods in it created by me) using VB.NET. Let me tell you what I have done to access the methods. I started with registering...
6
by: Andy Barber | last post by:
Hi, I'm trying to write an app that reads data from a table into a string variable for later use in my program. Below is a snippet of the code I'm using, which compiles ok, but at runtime I get...
8
by: Mike Caputo | last post by:
In VB.NET, need to be able to access certain properties on my main form from other forms. These are properties that may be changed by the user, so I have to be able to get to them throughout the...
0
by: Nijazi Halimaji | last post by:
Hi Newsgroup I have written a .NET Component, made the check on "register for COM interop" in Build options, create a strong name and registered the assembly in the GAC. Accessing this...
0
by: Mike | last post by:
Hello: I am trying to access a VB6 OCX file (with many important methods in it created by me) using VB.NET. Let me tell you what I have done to access the methods. I started with registering...
1
by: jimfollett1 via DotNetMonster.com | last post by:
Hey all, I was wondering if you could put me out of my misery (hopefully, not literaly) .. I am currently trying to port some VB6 code to VB.NET because of a possible significant performance...
2
by: jdanoz | last post by:
Hello, i have a vb.net project with a reference to an ActiveX object (ocx). If i try to use the ocx from vb6 project (adding the reference) it works ok (using CreateObject). In vb.net, the...
0
by: RSH | last post by:
Hi, I'm a veteran VB6 programmer venturing up to C#. I have seen a ton of examples of C# using different techniques for accessing a SQL database but I was wondering if there is a way to work...
0
by: Tobester | last post by:
Hi I am having problems accessing a vb6 dll from ASP.Net. The vb6 dll is registered. I have then created an interop file using tlbimp. The interop has been added to the GAC. I can run the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.