_XDocument3.Errors 屬性
取得與表單相關聯之 ErrorsCollection 的參照。
**命名空間:**Microsoft.Office.Interop.InfoPath
**組件:**Microsoft.Office.Interop.InfoPath (於 microsoft.office.interop.infopath.dll 中)
語法
'宣告
<DispIdAttribute(10)> _
ReadOnly Property Errors As ErrorsCollection
'用途
Dim instance As _XDocument3
Dim value As ErrorsCollection
value = instance.Errors
[DispIdAttribute(10)]
ErrorsCollection Errors { get; }
屬性值
與表單相關聯之 ErrorsCollection 的參照。
備註
Errors 集合與表單的基礎 XML 文件關聯,因此當錯誤發生時,它會在 XML 文件內發生。在設定 Errors 集合的參照後,即可存取它的所有屬性及方法,來管理 InfoPath 表單內的錯誤。
範例
在下列範例中,XDocument 物件的 Errors 屬性是用於傳回錯誤的計數,然後在訊息方塊中顯示值:
int errors;
errors = thisXDocument.Errors.Count;
thisXDocument.UI.Alert("Total number of errors: " + errors);
請參閱
參考
_XDocument3 介面
_XDocument3 成員
Microsoft.Office.Interop.InfoPath 命名空間