473,418 Members | 1,965 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,418 software developers and data experts.

Can IE be automated?

I have a textbox for storing the URL to a web page. I figured the
person could simply copy the URL from IE and paste it into the text box.
The client would like to have a more automated process.

We came upon one "glitch". We pasted the URL into the Access text box
and went back to it and it didn't go to the right page. The reason is
that frames were used in the page so although the page was OK, the
content wasn't.

To overcome that, we did a File/Save within IE and saved it to an htm
file on the drive. This gave us the correct content.

I mentioned to the client that a person could have 1 or many IE windows
open at one time. I suppose I could cycle through the class/caption
names and present a popup list to select the window they want. From
there, I'd suppose I could do a file save. The problem I see is that
when you do a File/Save, the folder most likely wont be the correct
folder...the drive is different, the folder different. So it would be
nice to stuff the drive/folder/filename too.

Is IE able to be automated? Can I tell it to File/Save and stuff
requistite values in it from Access if I know which page is selected?

Another thing I could do is have them save the page to C:\HTML. In the
form I could have a timer event and if the app saw a file in it to copy
the HTML file to a standardized network folder, kill the C:\HTML file,
and stuff the new network filename into the text box. Then again, I'd
have to FORCE the user to always save those pages/html files to
C:\HTML...and that's not automated.

Any ideas?
Nov 23 '05 #1
5 2492
Yes, you can automate IE. Set a reference to Microsoft Internet Controls
and then you can do things like:-

Form with three command buttson (Command0, Command1, Command2)

Option Explicit

Dim ie As SHDocVw.InternetExplorer

Private Sub Command0_Click()
Set ie = New SHDocVw.InternetExplorer

With ie
.Navigate2 "Some Valid Url In Here"
.Visible = True
End With
End Sub

Private Sub Command1_Click()
MsgBox ie.LocationURL
End Sub

Private Sub Command2_Click()
ie.Quit
Set ie = Nothing
End Sub

Private Sub Form_Load()
With Me
.Command0.Caption = "Open"
.Command1.Caption = "Get"
.Command2.Caption = "Close"
End With
End Sub
--
Terry Kreft

"Salad" <oi*@vinegar.com> wrote in message
news:uD***************@newsread1.news.pas.earthlin k.net...
I have a textbox for storing the URL to a web page. I figured the person
could simply copy the URL from IE and paste it into the text box. The
client would like to have a more automated process.

We came upon one "glitch". We pasted the URL into the Access text box and
went back to it and it didn't go to the right page. The reason is that
frames were used in the page so although the page was OK, the content
wasn't.

To overcome that, we did a File/Save within IE and saved it to an htm file
on the drive. This gave us the correct content.

I mentioned to the client that a person could have 1 or many IE windows
open at one time. I suppose I could cycle through the class/caption names
and present a popup list to select the window they want. From there, I'd
suppose I could do a file save. The problem I see is that when you do a
File/Save, the folder most likely wont be the correct folder...the drive
is different, the folder different. So it would be nice to stuff the
drive/folder/filename too.

Is IE able to be automated? Can I tell it to File/Save and stuff
requistite values in it from Access if I know which page is selected?

Another thing I could do is have them save the page to C:\HTML. In the
form I could have a timer event and if the app saw a file in it to copy
the HTML file to a standardized network folder, kill the C:\HTML file, and
stuff the new network filename into the text box. Then again, I'd have to
FORCE the user to always save those pages/html files to C:\HTML...and
that's not automated.

Any ideas?

Nov 23 '05 #2
Terry Kreft wrote:

Hi Terry Great stuff. Can you provide some more assistance? See below.
Yes, you can automate IE. Set a reference to Microsoft Internet Controls
and then you can do things like:-

Form with three command buttson (Command0, Command1, Command2)

Option Explicit

Dim ie As SHDocVw.InternetExplorer

Private Sub Command0_Click()
Set ie = New SHDocVw.InternetExplorer

With ie
.Navigate2 "Some Valid Url In Here"
.Visible = True
End With
End Sub

Private Sub Command1_Click()
MsgBox ie.LocationURL
End Sub

Private Sub Command2_Click()
ie.Quit
Set ie = Nothing
End Sub

Private Sub Form_Load()
With Me
.Command0.Caption = "Open"
.Command1.Caption = "Get"
.Command2.Caption = "Close"
End With
End Sub


I created a form with your code above and it worked like a champ...if
the web page did not open another web page in another window. For
example, I tested it out with the following page.
http://www.ferguson.com/MaufacturerL...nuflinks.shtml

The links on this page open up another page in another window. If I hit
"Get" it gets the link for the original page. I guess that should be
expected.

Let's say that the user called the original page but had 2/3 pages open.
I know I could cycle through the pages via class names and get the
captions for those pages. From there, I could present a listbox or
dropdown of those captions and let the op select the caption. Is there
anything I could do, from that list, to get the URL?

We decided that those that work with frames...well...hopefully there
aren't too many sites that use them. Frames are basically
"non-standard"...maybe they are common, hopefully not. But even getting
the URL for that would be OK...it's better than nothing.

I feel like I'm so close with your code...yet not quite there.

I didn't see any properties or methods where I could File/Save the page.
File/Saving handled the frames situation but that's not necessary per
the client's wishes...your code is so much better.

Nov 24 '05 #3
salad wrote:
Terry Kreft wrote:

Hi Terry Great stuff. Can you provide some more assistance? See below.

I think the following link answers my questions.
http://www.mvps.org/access/api/api0051.htm
Nov 25 '05 #4
Look like it ot me as well.

Thanks for stopping me from starting to hammer code <g>.

--
Terry Kreft

"salad" <oi*@vinegar.com> wrote in message
news:g0***************@newsread1.news.pas.earthlin k.net...
salad wrote:
Terry Kreft wrote:

Hi Terry Great stuff. Can you provide some more assistance? See below.

I think the following link answers my questions.
http://www.mvps.org/access/api/api0051.htm

Nov 25 '05 #5
Terry Kreft wrote:
Look like it ot me as well.

Thanks for stopping me from starting to hammer code <g>.

Yeah, and stopping you from enjoying a Happy Thanksgiving or duking it
out with other Walmart shoppers for the $399 laptop. :-)

I will use your code to launch the app. It's good stuff to know.
Nov 25 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Max M | last post by:
Yesterday there was an article on Slashdot: http://books.slashdot.org/article.pl?sid=03/09/04/1415210&mode=flat&tid=108&tid=126&tid=156 It is about automatic code generation. I got interrested...
2
by: Konstantin Zakharenko | last post by:
Hello, Our QA team have running a lot of test scripts (for automated regression testing), they run them on the different databases (Oracle/MS SQL). Several of those tests are dependent on the...
3
by: Chris | last post by:
I've been researching this on and off for weeks, and haven't come up with anything useful yet. If anyone knows how to do this, please let me know. From a Java applet running in IE 6.0 using the...
5
by: Maximus | last post by:
Guys, I need to make an automated script that runs every x seconds without using a CRON job. I heard there was a way doing it only in PHP. If you know any function that can be used please inform...
1
by: Amos Soma | last post by:
Can anyone suggest automated regression testing tools they use for the .Net apps? We would like to begin nightly automated testing of our apps. If it matters, we use Infragistics for our...
1
by: reymar | last post by:
1. What is the best software application in developing a database for Student Record System? 2. How to develop an Automated Student Record System? 3. What are the factors to be considered in...
1
by: rn5arn5a | last post by:
Nowadays, most websites make use of CAPTCHA to prevent automated Form submission. Can someone please give me examples of how automated Form submission can be achieved? It's not that I intend to...
0
by: Jordan S. | last post by:
Okay so I've finally "seen the Light" about writing automated unit tests ahead of time. Question: What is a very simple approach that I can use to setting up automated unit tests, considering...
1
by: =?Utf-8?B?UmljaGFyZCBCaXJk?= | last post by:
Hello, I have an issue with the recent Windows Automated Update disabling my ATI All-In-Wonder video capture card in Windows XP. Then when I reload the ATI software, the card works until the next...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.