Recipient 对象

         
多个对象
Recipient
多个对象

代表 Outlook 中的用户或资源,通常为邮件收件人。

使用 Recipient 对象

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

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

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

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

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

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