This project has moved and is read-only. For the latest updates, please go here.

Connect Event in ComAddin

Jun 22, 2011 at 2:49 PM


I wanted to connect the NewMailExEvent in your COMAddinClassicExample by inserting the line

_outlookApplication.NewMailExEvent += new Outlook.Application_NewMailExEventHandler(_outlookApplication_NewMailExEvent);

Every time this line is executed I get an AccessViolationException.

The EventBridgeInitialized member has the value false. I think that's the problem.

What do I have to do to solve this Probem? Can you give me an example for connecting to the NewMailExEvent?

Thank you.


Jun 22, 2011 at 2:52 PM
Edited Jun 22, 2011 at 3:09 PM

can you tell me more informations, .net version, outlook version 32/64Bit, and operating system?
i do a test immediately. maybe you are a outlook security victim or i do a mistake.
(note: the eventbridge was intialized on demand while first use)

Jun 22, 2011 at 3:09 PM

Hi Sebastian,

System: windows7 64bit

.Net: 4.0, Visual Studio 2010 with c#

Office 2010

I use the NetOffice Release 0.9\Net4.0\Examples\Outlook\C#\COMAddinClassicExample.

Jun 22, 2011 at 3:13 PM

Office 2010 is 32 or 64Bit ?

Jun 22, 2011 at 3:14 PM

i use office 2010 32bit

Jun 22, 2011 at 8:39 PM

the problem is located. the exception occurs only in a COMAddin and not in a normal program(.exe)
i do some tests now to resolve the problem, needs max. 1 or days (or nights) i believe.

sorry for inconvenience :-(

Jun 23, 2011 at 3:46 PM
Edited Jun 23, 2011 at 11:12 PM

hallo again,

 i do some changes in event bridge and it works now(sorry again)
 please download latest source and check Release Tags/NetOffice Release 0.9.rar
 AND please tell me it works for you or not! (my test with a COMAddin in outlook 2002 and NewMailEvent works fine)

 UPDATE: a new release is available with fixed event bridge.