| || |
I registered one method for browser class which opens a new window. Below is the code:-
Set WshShell = CreateObject("WScript.Shell")
Just before the execution reaches the above step if the focus on any other application say winword, then it opens a new word document.
Although i have registered this method for Browser class why is it doing operation on any focused application.
How can i modify it to work only for the browser class?
The behavior observed is pretty obvious. Because irrespective of what is the active window, SendKeys method presses the key sent as a parameter. So, we should use the method wisely...
An alternative would be activating the intended window using Activate method (or any other method) and then use Send Keys method.
Hope this solves your problem...
Add these lines to the beginning of your function
<font class="small">Code:</font><hr /><pre>
This will activate your browser and the ^n will open a new browser for you.