When developing Addin's for Outlook (or potentially other Office programs too) It can be useful to call methods back on the main class, but how do you do that from for example an event handler like a button_click event in a ribbon.
Asked
Active
Viewed 909 times
1 Answers
3
Use:
private void MyButton_click(object sender, RibbonControlEventArgs e)
{
Globals.ThisAddIn.MyMethod();
}

PiotrWolkowski
- 8,408
- 6
- 48
- 68

Essah
- 899
- 2
- 8
- 20
-
Please add some explanations. – PiotrWolkowski May 25 '15 at 21:28
-
I have a method in ThisAddIn class, I am able to access it from another project in the same solution but on running this I am getting null exception error Globals.ThisAddIn is null, how can I resolve this? – N Khan Nov 20 '19 at 04:47