Capturing the outlook events like reply, reply All, Forward , send, New email etc

Add-in Express™ Support Service
That's what is more important than anything else

Capturing the outlook events like reply, reply All, Forward , send, New email etc
 
Omkar Deshpande




Posts: 23
Joined: 2019-09-05
I want to add Popup and some processing during New Email, Reply, Reply All, Forward, Send events of the email. For this I used OutookItemEvents class. This class has some methods like ProcessForward, ProcessReply etc. To check its working, I added only messageboxes in these methods and nothing else(ex. MessageBox.Show("Reply button clicked...");). But These messageboxes are not getting invoked. Do I need to do anything more to get it work? Please guide me to use this functionality.
Also, I dont see any method for "New Email" button click, can you please let me know how to capture this as well.

If there is any video guide, it will also help.

Thanks,
Omkar
Posted 18 Nov, 2019 04:32:31 Top
Andrei Smolin


Add-in Express team


Posts: 17367
Joined: 2006-05-11
Hello Omkar,

Popup? Is that a context menu? Or a message box?

There's no New Email event. There's a Ribbon control(s) associated with the built-in Ribbon command. You can connect to that command and be informed when it is about to be invoked. You can cancel that command if you wish.

I suggest that you check section Office Ribbon UI Components in the manual; see the PDF file in the folder {Add-in Express}\Docs on your development PC. Pay special attention to sections Referring to built-in Office ribbon controls and Intercepting built-in Ribbon controls.

Omkar Deshpande writes:
But These messageboxes are not getting invoked.


That class is designed to intercept events on the *specified* Outlook item (such as MailItem, TaskItem, AppointmentItem, etc.). We demonstrate how to get that class working in section Events Classes; see the manual.

You can also find these sections at https://www.add-in-express.com/docs/net-ribbon-components.php and https://www.add-in-express.com/docs/net-components.php.

Also, we don't recommend using message boxes when debugging an add-in. This because a message box raises an extra event(s) that may spoil the picture. I suggest that you add debug messages to your code; use System.Diagnostics.Debug.WriteLine(). If the add-in is built in the Debug configuration, you collect the messages at run time using DebugView (see http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx). Or, you can use System.Diagnostics.Trace.WriteLine(); this works in the release mode as well if the TRACE constant is defined. To define that constant in a C# project, check the corresponding check box on the the Build tab of the project's properties. To find that check box in a VB.NET project, click button Advanced Compile Options on the Compile tab.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 18 Nov, 2019 05:25:00 Top
Omkar Deshpande




Posts: 23
Joined: 2019-09-05
Hi Andrei,

Thanks for the reply. I want to add modal dialog box on the reply,reply all, forward and send email events and based on user's input(Yes/No kind of buttons) on this dialog box, I will be doing some processing. I think it should be possible with the mail item events.
I will go through the links provided in your reply and get back to you if I face any issues.
Posted 18 Nov, 2019 06:23:54 Top
Andrei Smolin


Add-in Express team


Posts: 17367
Joined: 2006-05-11
Hello Omkar,

Feel free to write us if you run in an issue or need more information.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 18 Nov, 2019 06:26:15 Top