1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
Sub TestFull()
Dim i As Integer
Dim IE As InternetExplorer
Dim maPageHtml As HTMLDocument
Dim Helem As IHTMLElementCollection
Dim ParentWndHandle As Long
On Error Resume Next
'Call listerFenetres_IE_Ouvertes
'Call listerFenetres_IE_Ouvertes
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.navigate "http://127.0.0.1/Doc1.doc"
Do Until IE.readyState = READYSTATE_COMPLETE
DoEvents
Loop 'attend la fin du chargement
IE.Visible = True
'Fonction récuperation du handle et activation du bouton
Call FindWindow("#32770", "Téléchargement de fichier")
ParentWndHandle = FindWindow("#32770", "Téléchargement de fichier")
If ParentWndHandle <> 0 Then
Dim ChildWndHandle As Long
SetForegroundWindow ParentWndHandle
Pause 2 'Fonction pause de 2 seconde
SendKeys "%v", True
End If
End Sub |