Problem with Add-in for Outlook 2003, developped with c#

F

Franz Kiermaier

Hi all,
I have a big problem.
I am developping an Add-in for Outlook 2003 with c#.
in the OnStartupComplete method of the connect class i set a delegate to the
NewInspector event of the
Applications Inspectors collection.
So far so good. Everything works fine and the event is handled every time
the event fires.

But after a note is edited and outlook is closed, an error message appears,
that tells me, that the item could not be saved and a parameter is invalid.
Has anybody had this problem?

Thank you all for your help.

Franz

Here the code snippet

public void OnStartupComplete(ref System.Array custom)

{

((Microsoft.Office.Interop.Outlook.Application)this.applicationObject).Inspe
ctors.NewInspector += new
InspectorsEvents_NewInspectorEventHandler(Inspectors_NewInspector);

}



private void Inspectors_NewInspector(Inspector Inspector)

{

Do anything;

}
 
D

Dmitry Streblechenko \(MVP\)

When a Sticky Note is being edited (NoteItem), do not touch its inspector -
it is really fragile. You cannot do anything with its inspector anyway.
You can check either
(Inspector.CurrentItem.MessageClass != "IPM.StickyNote")
or
(Inspector.CurrentItem.Class != 44)

before you do anything else in the NewInspector handler.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
F

Franz Kiermaier

Hi Dmitry,

i do not anything with the note.
the program only runs into the event handler for the newInspector event and
nothing else.
Do you have any idea?

Franz
 
D

Dmitry Streblechenko \(MVP\)

That's exactly what I mean. NewInspector fires even when you open a sticky
mote. At the very beginning of your NewInspector event handler, perform the
check.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

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