IEのアクティブタブで開く。新しいタブで開く。新しいウィンドウで開く。
以前のIEでは、DDEのWWW_OpenURLでアクティブウィンドウなどに開けましたが、IE8では、インターネットオプション/全般/タブ/設定によって動作が変わります。
そこで、設定に影響されないで開く方法。
アクティブタブで開く.vbs URL
Set Shell=CreateObject("Shell.Application")
For k=Shell.Windows().Count-1 To 0 Step -1
Set ie=Shell.Windows().Item(k)
If LCase(Right(ie.FullName,13))="\iexplore.exe" Then
StatusText=CStr(Now)
ie.StatusText=StatusText
If ie.StatusText=StatusText Then Exit For
End If
Next
If IsEmpty(ie) Then
Set ie=CreateObject("InternetExplorer.Application")
ie.Visible=True
End If
ie.Navigate WScript.Arguments.Item(0)
新しいタブで開く.vbs URL
Set Shell=CreateObject("Shell.Application")
For k=Shell.Windows().Count-1 To 0 Step -1
Set ie=Shell.Windows().Item(k)
If LCase(Right(ie.FullName,13))="\iexplore.exe" Then Exit For
Next
If IsEmpty(ie) Then
Set ie=CreateObject("InternetExplorer.Application")
ie.Visible=True
End If
ie.Navigate2 WScript.Arguments.Item(0),&H800
※Navigateでは駄目なので、Navigate2を使用する。
新しいウィンドウで開く.vbs URL
Set ie=CreateObject("InternetExplorer.Application")
ie.Visible=True
ie.Navigate WScript.Arguments.Item(0)