次の方法で共有


Windows.Count プロパティ

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

名前空間: Microsoft.Office.Interop.InfoPath
アセンブリ: Microsoft.Office.Interop.InfoPath (microsoft.office.interop.infopath.dll 内)

構文

'宣言
<DispIdAttribute(1)> _
ReadOnly Property Count As Integer
'使用
Dim instance As Windows
Dim value As Integer

value = instance.Count
[DispIdAttribute(1)] 
int Count { get; }

次の例では、for ループ内で Count プロパティを使用して Window オブジェクトのコレクション全体のループ処理を行って、ウィンドウの種類の値を示すメッセージ ボックスを表示します。

for (int i=0; i < thisApplication.Windows.Count; i++)
{
 thisXDocument.UI.Alert("Window type: " + thisApplication.Windows[i].WindowType);
}

関連項目

参照

Windows インターフェイス
Windows のメンバ
Microsoft.Office.Interop.InfoPath 名前空間