I'm developing an Outlook Add In. It's pretty much done already, but there's one thing that I can't seem to put my finger on. In my (Outlook Add In) project I added a new item (Ribbon (Visual Designer)) which I called EmailTransferRibbon. This Ribbon is being displayed in Outlook. I want to be able to start my Outlook Add In when I click on this Ribbon button.
This is what my Ribbon looks like:
public partial class EmailTransferRibbon
{
private void EmailTransferRibbon_Load(object sender, RibbonUIEventArgs e)
{
}
private void btnEmailTransfer_Click(object sender, RibbonControlEventArgs e)
{
}
}
And this is the add in where I want the Ribbon button to navigate to:
public partial class ThisAddIn
{
EmailTransferForm emailTransferForm = new EmailTransferForm();
public void ThisAddIn_Startup(object sender, System.EventArgs e)
{
InboxFolderItemAdded();
Button btnRefresh = emailTransferForm.Controls.Find("btnRefresh", true).FirstOrDefault() as Button;
btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
}
}
I tried to do something like this, but this is a problem because RibbonControlEventArgs is not the same as System EventArgs:
var addIn = Globals.ThisAddIn;
addIn.ThisAddIn_Startup(sender, e);
Can someone tell me how to start the my add in by pressing the Ribbon button? thanks!