Je vois pas le problème, pour moi ce script marche
► Afficher le texte
Code : Tout sélectionner
#include <IE.au3>
#Include <Array.au3>
OnAutoItExitRegister("MyTestFunc")
Local $lien
Local $s_url = "http://titou.ctx.free.fr/";
Local $oIE = _IECreate($s_url)
Local $oLinks = _IELinkGetCollection($oIE,-1)
For $oLink In $oLinks
If StringLeft($oLink.href,12) = "https://msdn" Then $lien &= $oLink.href & @CRLF
$lien &= $oLink.href & @CRLF
Next
$aTableData = StringSplit($lien,@CRLF, 1)
_ArrayDisplay($aTableData)
For $i = 1 To $aTableData[0] - 1
$s_url = $aTableData[$i]
ConsoleWrite($s_url & @CRLF)
_IENavigate($oIE,$s_url,1)
Next
Func MyTestFunc()
MsgBox(0,"","ya eu un bug donc on quitte")
_IEQuit($oIE)
If @error Then ConsoleWrite(">>" & @extended & @CRLF)
EndFunc
Sinon pour une gestion d'erreur plus pointue sur les objets com :
► Afficher le texte
Code : Tout sélectionner
$title = StringRegExpReplace(@Autoitexe, '(.+)\\[^\\]+', "$1") & "\AutoIt.chm"
$oIE=ObjCreate("Shell.Explorer.2")
$gui = GUICreate($title, 700, 450, -1, -1, -1, 0x80)
$gX = GUICtrlCreateObj($oIE, 0, 0, 700, 450)
GUISetState()
$oIE.Navigate("mk:@MSITStore:" & $title & "::/html/intro/ComRef.htm")
GUICtrlSetPos ($gX, Default, 470-6070, Default, 6070)
While GuiGetMsg()<>-3
Wend
Note qu'avec des fonctions comme _IENavigate() le @error ne marche pas, et le error handler non plus puisque la commande est envoyée correctement
Comme le précise le fichier d'aide,
"You will need to employ other methods to determine success or failure of the navigation." ...et démerbrouille-toi avec ça
Par exemple
Code : Tout sélectionner
_IENavigate($oIE,"tilt",1)
; If @error Then MsgBox(0,"","erreur de navigation") ;<<<<<< ne marche pas !
If StringInStr(_IEDocReadHtml($oIE), "ErrorPage") Then MsgBox(0,"","erreur de navigation")