次の方法で共有


Errors.Count プロパティ

定義

コレクションに含まれるオブジェクトの ErrorObject 数を取得します。

public:
 property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer

プロパティ値

次の例では、Count プロパティを使用して、Error オブジェクトのコレクション全体を反復処理し、各エラーの短いエラー メッセージをメッセージ ボックスに表示します。

for (int i=0; i &lt; thisXDocument.Errors.<span class="label">Count</span>; i++)
{
 thisXDocument.UI.Alert("Error message: " + thisXDocument.Errors[i].ShortErrorMessage);
}

注釈

重要: このメンバーには制限なしでアクセスできます。

適用対象