Bonjour,
Voici une page html, maPage.html, qui contient une deuxième page html, page1.html :
Code HTML : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 <!DOCTYPE html> <html> <head> <title> partage avec hiérarchie imbriquée</title> </head> <frameset cols="20%,80%"> <frame src="page1.html" name="zone2"> <frameset rows="20%,80%"> <frame src="page2.html" name="zone1"> <frame src="page3.html" name="zone3"> </frameset> </frameset> </html>
Code HTML : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 <!DOCTYPE html> <html> <head> <ul id="menu-vertical"> <li><a href="https://www.google.fr">GOOGLE</a> </li> </ul> </html>
Je voudrais faire un clic sur le lien situé sur page1.html.
Sauriez-vous me dire ce que je dois taper en vbs pour accomplir cette action, svp?
Code VBA : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 Option Explicit Dim objApp, Window, monURL, count Set objApp = CreateObject("Shell.Application") count = -1 For Each Window In objApp.Windows If Window = "Internet Explorer" Then count = count+1 monURL = objApp.Windows(count).locationUrl msgbox monURL if monURL = "file:///C:/Users/username/Desktop/maPage.html" then 'window.top.frames(1).Document.getElementsById("menu-vertical")(0).Click 'window.frames().Document.getElementsByTagName("a").item(0).innerHTML 'CODE POUR FAIRE LE CLIC" end if End If Next
Merci d'avance de votre aide.
Arsene
Partager