'サンプル4.2.4_画面遷移を待ち受ける Busy属性とReadyState属性の監視
Public Sub
navigateAndSetValue4()
Dim ie As
InternetExplorer
'IE起動→Googleに遷移
Set ie =
CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.Navigate2
"http://www.google.co.jp/"
'待ちうけ
Do While ie.Busy Or ie.ReadyState <
READYSTATE_COMPLETE
Debug.Print ie.Busy & "/" & ie.ReadyState
DoEvents
Loop
Debug.Print ie.Busy &
"/" & ie.ReadyState
'Googleのフォームに値をセットして検索実行
ie.document.forms("f").elements("q").Value
= "ぼたもち おはぎ 違い"
ie.document.forms("f").submit
End