次の方法で共有


_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);

注釈

フォームの基になる XML ドキュメントには Errors コレクションが関連付けられており、エラーが発生するときには XML ドキュメント内で発生します。 Errors コレクションへの参照を設定すると、InfoPath フォームで発生したエラーを管理するためのプロパティおよびメソッドにアクセスできるようになります。

重要: このメンバーにアクセスできるのは、現在開いているフォームと同じドメインで実行されているフォーム、またはクロスドメインアクセス許可が付与されているフォームのみです。

適用対象