我正在尝试枚举Outlook文件夹中的不同邮件项目。
一些邮件项目是ReportItems ...我可以告诉它,因为它们的Class = 46.但是,当我尝试使用((Outlook.ReportItem)项目将__ComObject强制转换为ReportItem时)我得到了这个异常:< / p>
AutoResolvedWinner {System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: The operation failed.
--- End of inner exception stack trace ---
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Dynamic.IDispatchComObject.GetMembers(IEnumerable`1 names)} System.Reflection.TargetInvocationException
如果有帮助,该对象的MessageClass属性为&#34; REPORT.IPM.Note.NDR&#34;
帮助将不胜感激。