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
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