0
votes

I have a outlook Add-in from which using C# program I have to get the focus of outlooks outbox. This is because on getting control of any mail item I have a button in the Ribbon that gets activated. Ideally I want to trigger that Split-button. I tried getting it as below but it fetches the only information of the mail like subject but won't get the focus or control of the outbox.

Microsoft.Office.Interop.Outlook._NameSpace oNs = OutlookApp.GetNamespace("MAPI");
Outlook.MAPIFolder outbox = this.Application.ActiveExplorer().Session.
GetDefaultFolder(Outlook.OlDefaultFolders.olFolderOutbox);
Outlook.MailItem outboxFirstmail = outbox.Items.GetFirst() as Outlook.MailItem;
1

1 Answers

0
votes

Set the Application.ActiveExplorer.CurrentFolder property and call Application.ActiveExplorer.AddToSelection

Keep in mind that touching an item being submit will abort the submission process.