|
-
May 26th, 2004, 02:16 AM
#1
Thread Starter
Lively Member
Click a link on IE browers
Hi, I was wondering how would I be able to click a link on IE?
Julie Luvs

-
May 26th, 2004, 02:23 AM
#2
KING BODWAD XXI
-
May 26th, 2004, 02:30 AM
#3
Thread Starter
Lively Member
well, yes i can do that, but im trying to make it clicks all IE browers thats open

any ideas how?
Julie Luvs

-
May 26th, 2004, 02:36 AM
#4
KING BODWAD XXI
-
May 26th, 2004, 02:41 AM
#5
Thread Starter
Lively Member
suspicious?
hm.. ok
if you not going to help, there no need for your disrespectful comments, please let someone else reply. thank you
Last edited by Julie_Luvs; May 26th, 2004 at 02:50 AM.
Julie Luvs

-
May 26th, 2004, 02:53 AM
#6
-
May 26th, 2004, 02:56 AM
#7
Thread Starter
Lively Member
it's a link on a page on a forum im an editor of
Julie Luvs

-
May 26th, 2004, 03:55 AM
#8
-
May 26th, 2004, 04:35 AM
#9
Addicted Member
First things to go through my head as well... You could try enumerating through all windows/controls, and sending an API message to click on the link you need. But, BodwadUK's idea is much easier.
-
May 26th, 2004, 05:22 AM
#10
Fanatic Member
No. no, this is much easier... I used this code in one of my IE plug-ins. I've modified it, so now all instances of IE navigate to www.vbforums.com. Not sure if that is what you want, since every IE window is affected by this code... Also, this code does not click a link, it navigates to one. If you really need the clicking, let me know. 
VB Code:
Dim objWindows As Object, objIE As Object
Set objWindows = CreateObject("Shell.Application").windows
If objWindows.Count > 0 Then 'Make sure there are windows
For Each objIE In objWindows
If InStr(1, objIE.FullName, "IEXPLORE.EXE", vbTextCompare) <> 0 Then 'IE instead of Windows Explorer
objIE.Navigate "http://www.vbforums.com"
End If
Next
End If
Set objWindows = Nothing
Set objIE = Nothing
Author for Visual Basic Web Magazine
-
May 26th, 2004, 05:43 AM
#11
Thread Starter
Lively Member
Hi TheVader,
good to see you around again
yes i do need one that clicks, if you may.
thanks again

(BodwadUK thank you too, but i have no idea how to do that)
Julie Luvs

-
May 26th, 2004, 05:55 AM
#12
-
May 26th, 2004, 08:04 AM
#13
Fanatic Member
OK, this should do it. I've added a check for the page title because otherwise you wouldn't be able to have any other IE windows opened.
VB Code:
Dim objWindows As Object, objIE As Object, i As Integer
Set objWindows = CreateObject("Shell.Application").windows
If objWindows.Count > 0 Then 'Make sure there are windows
For Each objIE In objWindows
If InStr(1, objIE.FullName, "IEXPLORE.EXE", vbTextCompare) <> 0 Then 'IE instead of Windows Explorer
If InStr(1, LCase(objIE.Document.Title), "website.com") <> 0 Then 'Checking if the title contains "website.com"
For i = 0 To objIE.Document.links.length - 1 'Loop through the links collection
If objIE.Document.links.Item(i).innerText = "Click here" Then 'If the link text is the one we're looking for
objIE.Navigate objIE.Document.links.Item(i) 'Navigate to the page
End If
Next i
End If
End If
Next
End If
Set objWindows = Nothing
Set objIE = Nothing
Last edited by TheVader; May 26th, 2004 at 10:15 AM.
Author for Visual Basic Web Magazine
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|