Function Test_mot_dans_URL_Existe(titre As String) As Boolean
'Nécessite d'activer la référence
'"Microsoft Internet Controls"
'et
'"Microsotf HTML Object Library"
Dim trouve As Boolean
Dim IE As New InternetExplorer
Dim winShell As New ShellWindows
Dim maPageHtml As HTMLDocument
Test_mot_dans_URL_Existe = True
trouve = False
For Each IE In winShell
Set maPageHtml = IE.document
'MsgBox "page : " & maPageHtml.url & " -Test : " & titre & "" & (InStr(maPageHtml.url, titre))
If (InStr(maPageHtml.url, titre) <> 0) Then
MsgBox "page : " & maPageHtml.Title
trouve = True
Set maPageHtml = Nothing
End If
Next
If trouve = True Then
MsgBox "1"
Test_mot_dans_URL_Existe = True
Else
MsgBox "2"
Test_mot_dans_URL_Existe = False
End If
End Function