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

an error about System.Runtime.InteropServices.Marshal.ReleaseComObject(rules);

Jul 9, 2011 at 1:25 PM


I want to remove a outlook rule with following code, but i get an error but no error in Microsoft.Office.Interop.Outlook


 error :

Message=The object's type must be __ComObject or derived from __ComObject.


Jul 9, 2011 at 1:54 PM

what the hell you doing? :o
ReleaseComObject release a COM proxy, you dont remove anything in outlook with this(btw: i dont know what is a rule in outlook)
the method awaits a com proxy but NetOffice wraps COM proxies for you in wrapper classes and gives you a smarter way to release: rule.Disose();
please read:
and take a look at the tutorials.


Jul 9, 2011 at 3:01 PM


       Thank you very much ,i can remove a outlook rule.

       Pls open Outlook client such Outlook 2007 ,Outlook -- Tools -- Rules and Alerts..,you can see the Outlook rule. ^_^