NameSpace.GetSelectNamesDialog メソッド (Outlook)

現在のセッションの SelectNamesDialog オブジェクトを取得します。

構文

GetSelectNamesDialog

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

戻り値

現在のセッションの SelectNamesDialog オブジェクトです。 SelectNamesDialog オブジェクトは、現在のセッションで 1 つまたは複数のアドレス一覧からエントリを選択するユーザーの 名前の選択] ダイアログ ボックスの表示をサポートします。

次のコード サンプルでは、現在のセッションの selectnamesdialog オブジェクト のインスタンスをインスタンス化して、Outlook のユーザー インターフェイスの [ 名前の選択] ダイアログ ボックスのようなダイアログ ボックスに連絡先フォルダーからエントリを表示する方法を示します。

Sub ShowContactsInDialog() 
 Dim oDialog As SelectNamesDialog 
 Dim oAL As AddressList 
 Dim oContacts As Folder 
 
 Set oDialog = Application.Session.GetSelectNamesDialog 
 Set oContacts = _ 
 Application.Session.GetDefaultFolder(olFolderContacts) 
 
 'Look for the address list that corresponds with the Contacts folder 
 For Each oAL In Application.Session.AddressLists 
 If oAL.GetContactsFolder = oContacts Then 
 Exit For 
 End If 
 Next 
 With oDialog 
 'Initialize the dialog box with the address list representing the Contacts folder 
 .InitialAddressList = oAL 
 .ShowOnlyInitialAddressList = True 
 If .Display Then 
 'Recipients Resolved 
 'Access Recipients using oDialog.Recipients 
 End If 
 End With 
End Sub

関連項目

NameSpace Object

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

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