views:

152

answers:

6

Hi All,

I need to get an automation macro like thing within our desktop application. The desktop app will probably be in VB.NET or C#.net. The reason is to enable the user to record and replay certain tasks that they'd like to automate. Something like macros within office apps and visual studio. The first thing that comes to my mind is VBA.

Is this the right approach or whether are there any other options available?
Any gotchas or things to look out for, if some body has already done it before.
Some helpful links to get me going.

Whatever little help is highly appreciated.

Thanks in Advance.
Samrat.

P.S. This is a quite generic question not belonging to any specific technology. If some of you think the tags are inappropriate or if it needs some more tags which I missed out, feel free to edit them :)

+1  A: 

Does it have to be built in your application? There are macro solutions on the Windows level (assuming that's your target OS)

ohadsc
+9  A: 

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!

Philipp
I think this is basically right. VBA would be overkill if you don't need a general programming language. If you *do* need a general programming language, just using a .NET language would be much less of a pain than finding a way to use VBA.
jtolle