ErrorsCollection 接口

定义

包含 ErrorObject Microsoft InfoPath 表单中每个错误的 对象。

public interface class ErrorsCollection : Microsoft::Office::Interop::InfoPath::SemiTrust::Errors
[System.Runtime.InteropServices.Guid("096cd578-0786-11d1-95fa-0080c78ee3bb")]
public interface ErrorsCollection : Microsoft.Office.Interop.InfoPath.SemiTrust.Errors
type ErrorsCollection = interface
    interface Errors
Public Interface ErrorsCollection
Implements Errors
属性
实现

示例

//Add an error to the node
IXMLDOMDocument myDOM = thisXDocument.DOM;
IXMLDOMNode myNode = myDOM.selectSingleNode("my:myFields/my:aGroup/my:field1");
thisXDocument.<span class="label">Errors</span>.Add(myNode,"condition","short","detail",102057,"modeless");
  <p>The <strong>Errors</strong> collection is accessed through the <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.Interop.InfoPath.SemiTrust._XDocument2.Errors"></xref> property of the <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.Interop.InfoPath.SemiTrust.XDocument"></xref> object.</p>
  <code>&lt;span class="label"&gt;ErrorsCollection&lt;/span&gt; err = thisXDocument.Errors;</code>

注解

此类型是用于 Coclass(托管代码需要此 Coclass 来实现 COM 互操作性)的包装。 使用此类型来访问由此 Coclass 实现的 COM 接口。 有关 COM 接口的信息(包括指向其成员说明的链接),请参阅Errors

Errors 集合提供用于添加、删除和访问所包含的 Error 对象的属性和方法。

除了管理 InfoPath 生成的错误外, Errors 集合还可用于使用 Add(Object, String, String, String, Int32, String) 方法创建自定义错误。

注意:也可以使用 对象的 方法DataDOMEventObject创建自定义ReportError(Object, String, Boolean, String, Int32, String)错误。

属性

Count

获取集合中包含的对象数 ErrorObject 的计数。

(继承自 Errors)
Item[Int32]

从集合中获取对指定 ErrorObject 对象的引用。

(继承自 Errors)

方法

Add(Object, String, String, String, Int32, String)

将 添加到 ErrorObjectErrorsCollection 并返回对新 Error 对象的引用。

(继承自 Errors)
Delete(Object, String)

ErrorsCollection集合中删除指定的 ErrorObject 对象。

(继承自 Errors)
DeleteAll()

删除集合中包含的ErrorsCollection所有ErrorObject对象。

(继承自 Errors)
GetEnumerator()

获取一个循环访问对象中所有条目的 ErrorsCollectionIEnumerator

(继承自 Errors)

适用于