Create automation macro support within an application Create automation macro support within an application vba vba

Create automation macro support within an application


Are you thinking of macros that are just for "record-replay" of some consecutive actions? This might be pretty well doable if you use the Command pattern in your UI programming. Then every user action is described by an object (derived from an abstract Command class having a "execute()" method). Now recording and replaying is simply storing a list of command objects, serializing them and your macro is done. For replaying it you simply deserialize the data and execute the list of commands again.

Hope that helps!


VSTA (Visual Studio Tools for Applications) is the replacement for VBA. It hasn't caught on as much as VBA did with 3rd party vendors or even in MSFT's own products (the only one that currently has it is InfoPath). But it's far more modern than VBA, if that is a concern.

Check out VSTA main page, and in particular the video: Integrating VSTA to Enable Macro Recording.