Outlook ItemSend

C

Craig

Hi

I have a Fwk 1.1 Outlook Add-in project. I'm attaching to the ItemSend
event, the problem I'm having is when I send an e-mail, the event is fired
which I can intercept ok, however the ItemSend argument: object Item can not
be converted to a .NET Office interop MailItem object. Here's what I'm doing:

private void OnMessageSend(object Item, ref bool Cancel) {
MailItem mailItem = Item as MailItem;

if(mailItem == null) {
return;
}

// Do something with mailItem variable based on the MailItem class.
}

What I have for mailItem (which is the same as Item) varibale is the
following object in my Local window in the debugger:

NAME VALUE
- mailItem {System.__ComObject}
- [System.__ComObject] {System.__ComObject}
- System.MarshalByRefObject {System.__ComObject}
System.Object {System.__ComObject}
__identity <undefined value>
m_ObjectToDataMap <undefined value>
m_wrap 90777040

I'm at a loss as to how I can get around this show stopper; I would greatly
appreciate any suggestions.

Craig
 
C

Craig

The problem was when retrieving the MailItem property values, is to check
that the property is not null.

Craig
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top