I am in Outlook 2010 in Windows 7 writing in VBA and want to pass the name of a macro (or sub routine) as a string variable to another sub routine and have that routine run the macro. In Word you can do this with Application.Run MacroName:=strMacroName Where strMacroName is a string variable with the name of the macro. That approach does not work in Outlook 2010. How can I accomplish the same thing? I tried
Call Application.strMacroName
Call strMacroName
strMacroName
on its own lineOutlook.Application.strMacroName
None of those things worked.
I just upgraded to Outlook 2010 and so can no longer use keyboard shortcuts to run custom code for handling email. So to restore some version of that functionality I have created code to present a dialog box with my most common macros. The code is fairly clean to modify as time goes along and pass along the name of the macro I want to run but I used to be able to run that routine in one command (Application.Run MacroName:=strMacroName
).
Now I have to include a long switch statement to accomplish the same thing. Not nearly as simple.
Thanks!