TaskRequestDeclineItem.AttachmentRead 事件 (Outlook)

当打开父对象实例中的附件进行阅读时发生。

语法

expressionAttachmentRead( _Attachment_ )

表达 一个代表 TaskRequestDeclineItem 对象的变量。

参数

名称 必需/可选 数据类型 说明
Attachment 必需 Attachment 打开该 附件

示例

此 Visual Basic for Applications (VBA) 示例在用户试图读取附件时显示一条消息。 示例代码必须放在 类模块(如 ThisOutlookSession)中,并且 TestAttachRead() 应在 Microsoft Outlook 调用事件过程之前调用过程。 若要运行此示例,收件箱中必须至少有一个主题为"Test"的项目,并且其中至少包含一个附件。

Public WithEvents myItem As outlook.MailItem 
 
 
 
Private Sub myItem_AttachmentRead(ByVal myAttachment As Outlook.Attachment) 
 
 If myAttachment.Type = olByValue Then 
 
 MsgBox "If you change this file, also save your changes to the original file." 
 
 End If 
 
End Sub 
 
 
 
Public Sub TestAttachRead() 
 
 Dim atts As Outlook.Attachments 
 
 Dim myAttachment As Outlook.Attachment 
 
 
 
 Set myItem = Application.ActiveExplorer.CurrentFolder.Items("Test") 
 
 Set atts = myItem.Attachments 
 
 myItem.Display 
 
End Sub

另请参阅

TaskRequestDeclineItem 对象

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。