Share via


Application.Explorers プロパティ (Outlook)

開いているすべてのエクスプ ローラーを表す Explorer オブジェクトを格納している エクスプ ローラー コレクション オブジェクトを返します。 読み取り専用です。

構文

expression. Explorers

expressionApplicationオブジェクトを表す変数 。

次の Microsoft Visual Basic for Applications (VBA) の例は、開いているエクスプローラー ウィンドウの数を表示します。

Private Sub CountExplorers() 
 
 MsgBox "There are " & _ 
 
 Application.Explorers.Count & " Explorers." 
 
End Sub

The following VBA example uses the Count property and Item method of the Selection collection returned by the Selection property to display the senders of all mail items selected in the explorer that displays the Inbox. To run this example, you need to have at least one mail item selected in the explorer displaying the Inbox. You might receive an error if you select items other than a mail item such as task request as the SenderName property does not exist for a TaskRequestItem object.

Sub GetSelectedItems() 
 
 Dim myOlExp As Outlook.Explorer 
 
 Dim myOlSel As Outlook.Selection 
 
 Dim MsgTxt As String 
 
 Dim x As Integer 
 
 
 
 MsgTxt = "You have selected items from: " 
 
 Set myOlExp = Application.Explorers.Item(1) 
 
 If myOlExp = "Inbox" Then 
 
 Set myOlSel = myOlExp.Selection 
 
 For x = 1 To myOlSel.Count 
 
 MsgTxt = MsgTxt & myOlSel.Item(x).SenderName & ";" 
 
 Next x 
 
 MsgBox MsgTxt 
 
End If 
 
End Sub

関連項目

Application オブジェクト

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。