Can I use VB to run a macro in any Microsoft application?

  • Thread starter Thread starter Neji
  • Start date Start date
N

Neji

Can I use VB to run a macro in any Microsoft application?

My goal is to place the following in a macro: "Alt+tab, Alt+spacebar,
'M', left mouse click". This will allow me to switch mouse focus when
I switch applications.

The problem is that I've only made VBA scrips in Excel, and I don't
think that these VBA macros work outside of Excel. Can VB be used
outside of Excel? Is this something that can be done in .NET or
regular VB?
 
Using SendKeys like that is always a bad idea. You are "assuming" the window
has the focus, but you never really know. Automation is the way to go
 
Back
Top