Option
Explicit
Sub
Test()
Dim
objShell
As
Object
Dim
objWindows
As
Object
Dim
objWindow
As
Object
Dim
objItems
As
Object
Set
objShell = CreateObject(
"Shell.Application"
)
Set
objWindows = objShell.Windows
For
Each
objWindow
In
objWindows
Debug.Print objWindow.LocationName; Tab(5); objWindow.LocationURL
If
InStr(objWindow.LocationURL,
"google.de"
)
Then
Set
objItems = objWindow.Document.getElementsByName(
"q"
)
If
objItems.Length > 0
Then
objItems(0).Value =
"Blaaaah~Blub"
Set
objItems = objWindow.Document.getElementsByName(
"btnK"
)
If
objItems.Length > 0
Then
objItems(0).Click
End
If
End
If
End
If
Next
End
Sub