_XDocument2.Errors 属性

定义

获取对 ErrorsCollection 与窗体关联的 的引用。

public:
 property Microsoft::Office::Interop::InfoPath::SemiTrust::ErrorsCollection ^ Errors { Microsoft::Office::Interop::InfoPath::SemiTrust::ErrorsCollection ^ get(); };
public Microsoft.Office.Interop.InfoPath.SemiTrust.ErrorsCollection Errors { get; }
member this.Errors : Microsoft.Office.Interop.InfoPath.SemiTrust.ErrorsCollection
Public ReadOnly Property Errors As ErrorsCollection

属性值

实现

示例

在以下示例中,对象的 Errors 属性 XDocument 用于返回一个或多个错误的数目,然后在消息框中显示该值:

int errors;

errors = thisXDocument.<span class="label">Errors</span>.Count;
thisXDocument.UI.Alert("Total number of errors: " + errors);

在以下示例中,对象的 Errors 属性 XDocument 用于返回一个或多个错误的数目,然后在消息框中显示该值:

int errors;

errors = thisXDocument.<span class="label">Errors</span>.Count;
thisXDocument.UI.Alert("Total number of errors: " + errors);

注解

Errors 集合与表单的基础 XML 文档相关联,以便在发生错误时,该错误发生在 XML 文档内部。 在设置了对 Errors 集合的引用之后,可以访问该集合的所有属性和方法以便在 InfoPath 表单内管理错误。

重要提示:此成员只能由与当前打开的窗体在同一域中运行的表单访问,或者由已授予跨域权限的表单访问。

适用于