Recipients 对象

         
多个对象
Recipients
多个对象

Recipients 对象中包含 Recipient 对象。

使用 Recipients 对象

使用 Recipients 属性返回 AppointmentItemJournalItemMailItemMeetingItemTaskItem 对象的 Recipients 对象。

使用 Add 方法新建 Recipient 对象,并将其添加到 Recipients 对象中。新 Recipient 对象的 Type 属性被设置为相关的 AppointmentItemJournalItemMailItemTaskItem 对象的默认值,如果要改用其他收件人类型,必须重新设置该属性。

以下示例新建一个 MailItem 对象并使用默认类型(“收件人”)将“Jon Grande”添加为收件人。

Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)
Set myRecipient = myItem.Recipients.Add ("Jon Grande")

以下示例创建与上例相同的 MailItem 对象,然后将 Recipient 对象的类型从默认的(“收件人”)更改为“抄送”。

Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)
Set myRecipient = myItem.Recipients.Add ("Jon Grande")
myRecipient.Type = olCC

使用 Recipients(index) 返回单个 Recipient 对象。其中,index 是名称或索引号。