Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Visual Studio Tools for Office
|
Visual Studio Tools for Office Be sure to specify which version you are working with.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio Tools for Office section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 13th, 2007, 07:06 AM
Registered User
 
Join Date: Nov 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Capturing the send event of Outlook 2003

Hello ,
I am trying to capture the Outlook 2003 Send event. I have used a Add-in project to do the required.
Since outlook.MailItem does not have a send event i have used a delegate to declare a send event and call the event.
But i think i am going wrong somewhere bcoz when i try to debug the project line by line the delegate does not get debugged. Can anyone plz tell me where am i going wrong ?

--- In the Class area ,declared the following objects:----

public Outlook.Application OutlookApplication;
public Outlook.Inspectors OutlookInspectors;
public Outlook.Inspector OutlookInspector;
public Outlook.MailItem OutlookMailItem;
public delegate void ApplicationEvents_11_ItemSendEventHandler(object Item, ref bool Cancel);

----- In the OnConnection function: ---------

applicationObject = application;
addInInstance = addInInst;
OutlookApplication = application as Outlook.Application;
OutlookInspectors = OutlookApplication.Inspectors;
OutlookInspectors.NewInspector += new InspectorsEvents_NewInspectorEventHandler(OutlookI nspectors_NewInspector);
OutlookApplication.ItemSend += new Outlook.ApplicationEvents_11_ItemSendEventHandler( OutlookMailItem_Send);

----- in the OutlookMailItem_Send function --------

 string strchkTo = OutlookMailItem.To;
 string strchk = "hello Welcome to c#";

---- In the OutlookInspectors function --------

OutlookInspector = (Outlook.Inspector)Inspector;
if (Inspector.CurrentItem is Outlook.MailItem)
   {
      OutlookMailItem = (Outlook.MailItem)Inspector.CurrentItem;
   }









Similar Threads
Thread Thread Starter Forum Replies Last Post
mouse event capturing in IE6 using VB6 amyourpet VB How-To 0 January 25th, 2008 08:01 AM
Capturing a "Enter" key event in C# windows applic bhavna VS.NET 2002/2003 1 March 15th, 2007 07:45 AM
Capturing the onkeydown event richard.york Javascript How-To 5 December 27th, 2005 04:27 PM
Capturing Mouse Click Event whiterainbow ASP.NET 1.0 and 1.1 Professional 1 December 8th, 2005 01:44 AM
Capturing the Control + C event Sammy8932 Access VBA 8 June 8th, 2005 09:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.