List 6-48 Customersコレクションを利用した実装例
  1: Function GetCustomers5() As Customers
  2:     Dim objCustomers As Customers
  3:     
  4:     ' Customersオブジェクトを作成
  5:     Set objCustomers = New Customers
  6:     
  7:     ' データを設定
  8:     objCustomers.Add "ソフトバンクパブリッシング", _
                          "03-1234-5678", "03-1234-5679"
  9:     objCustomers.Add "マイクロソフト", _
                          "03-2345-6789", "03-2345-6790"
 10: 
 11:     ' 戻り値を設定
 12:     Set GetCustomers5 = objCustomers
 13:     
 14:     ' オブジェクトを解放
 15:     Set objCustomers = Nothing
 16:     
 17: End Function