In VBA there is an event that you can listen to when Corel starts: GlobalMacroStorage_Start
For example, you could put the following in MyMacro.gms -> CorelDRAW X7 Objects -> ThisMacroStorage:
Private Sub GlobalMacroStorage_Start() MsgBox "Everything has started (GMS)" End Sub
Is there a similar event that I can listen to in VSTA? I have code that runs on a constructor, but the message box that says "Everything has started (VSTA)" only runs if I call Macro1 directly:
[CgsAddInModule] public partial class Addons { private VGCore.Application mApplication;
[CgsAddInConstructor] public Addons(object aApplication) { MessageBox.Show("Everything has started (VSTA)"); mApplication = aApplication as VGCore.Application; Startup(); } [CgsAddInMacro] public void Macro1() { MessageBox.Show("Macro1 - " + mApplication.Name); } }
Any thoughts?