C# Outlook 2007 COM-interop-Anwendung nicht verlassen!

Irgendwelche Ideen, warum der folgende code nicht beenden von Outlook 2007 erstellten Prozess über COM-interop?

Microsoft.Office.Interop.Outlook.Application app = new Microsoft.Office.Interop.Outlook.Application();

var item = app.Session.OpenSharedItem("C:\\test.msg") as Microsoft.Office.Interop.Outlook.MailItem;
string body = item.HTMLBody;
int att = item.Attachments.Count;

(item as Microsoft.Office.Interop.Outlook._MailItem).Close(Microsoft.Office.Interop.Outlook.OlInspectorClose.olDiscard);
System.Runtime.InteropServices.Marshal.ReleaseComObject(item);

(app as Microsoft.Office.Interop.Outlook._Application).Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject(app);
System.Diagnostics.Debugger.Break();

Ein fast identisches snippet mit Word arbeitet, so Frage ich mich, ob ich vergessen zu bereinigen, etwas...

InformationsquelleAutor Nikolaos | 2009-12-15
Schreibe einen Kommentar