Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Visual Studio Tools for Office
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old November 13th, 2007, 06:06 AM
Registered User
Join Date: Nov 2007
Location: , , .
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;

Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
mouse event capturing in IE6 using VB6 amyourpet VB How-To 0 January 25th, 2008 07: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 03:27 PM
Capturing Mouse Click Event whiterainbow ASP.NET 1.0 and 1.1 Professional 1 December 8th, 2005 12:44 AM
Capturing the Control + C event Sammy8932 Access VBA 8 June 8th, 2005 09:05 AM

All times are GMT -4. The time now is 01:31 PM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.