I\'m am trying to send some keystrokes to a program. I have some example code below which works fine up until the final {Alt}
command. I believe this is due to
Each windows process has an identifier. If you store the process id for each notepad window, you can avoid worrying about finding the right window after its title changes.
Here is an example of opening two notepad files, activating by process id and sending keys.
Set objShell = WScript.CreateObject("WScript.Shell")
Function SendKeysTo (process, keys, wait)
objShell.AppActivate(process.ProcessID)
objShell.SendKeys keys
WScript.Sleep wait
End Function
Set notepadA= objShell.Exec("notepad")
Set notepadB= objShell.Exec("notepad")
WScript.Sleep 500
SendKeysTo notepadA, "Hello I am Notepad A", 1000
SendKeysTo notepadB, "Hello I am Notepad B", 1000
Hopefully you can take a similar approach to solve your problem.