全部显示

Attachment 对象

         
Attachments
Attachment
NameSpace

代表文档或包含在 Outlook 项目中指向文档的链接。

使用 Attachment 对象

使用 Attachments(index) 返回单个 Attachment 对象。其中 index 是索引号。

使用 Add 方法将附件添加到项目中。

以下 Visual Basic for Applications 示例新建一个邮件,将 Q496.xls 作为附件(不是链接)附加,并为附件设置一个描述性标题。

Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)
Set myAttachments = myItem.Attachments
myAttachments.Add "C:\My Documents\Q496.xls", _
    olByValue, 1, "4th Quarter 1996 Results Chart"