Hi,
I am looking for any documentation or sample code to use Dynamics Macro2 class using the Interop.Dynamics DLL in Visual Studio C# winforms application.
There are StartPlay/StopPlay/StartRecord/StopRecord methods in the Macro2 class. When trying to StartPlay.StartRecord/StopRecord a macro file, nothing happens (See project steps below). Thanks for any help in advance.
The steps in the project are below with sample code..
1. Add Interop.Dynamics.DLL to the project reference
2. Created form with 2 buttons to start record macro and stop record macro
3. In form code to declare class
public Dynamics.Macro2 GPMacro2 = null;
public Dynamics.Application GPApp = null;
4. Add code to create instance (Note: Dynamics is already running)
if (GPApp == null)
{
GPApp = (Dynamics.Application)Activator.CreateInstance(Type.GetTypeFromProgID("Dynamics.Application"));
GPMacro2 = (Dynamics.Macro2)Activator.CreateInstance(Type.GetTypeFromProgID("Dynamics.Macro2"));
}
GPApp.CurrentProductID = 0;
GPApp.Activate();
int i = GPMacro2.StartPlay(@"C:\_Macros\t.mac", 0);
Thanks in advance,
Tak
*This post is locked for comments