vba - Outlook VBA 声明中召回的消息

标签 vba outlook

我正在尝试找出 Outlook 中撤回邮件的数据类型。

定义邮件项目时,不包括任何撤回消息,因为它们不被视为邮件项目。下面是声明邮件项变量的代码行

Dim msg As Outlook.MailItem 

有人知道声明撤回消息的正确方法是什么吗?

最佳答案

要撤回已发送邮件 - 选择“已发送”文件夹中的电子邮件并运行以下命令 .

Option Explicit
Sub Recall()
  Dim SendItem As Object
  Dim olItem As Outlook.MailItem
  Dim olInsp As Outlook.Inspector

  '// Selected item in Sent Items folder
  Set SendItem = ActiveExplorer.Selection.Item(1)

  If TypeName(SendItem) = "MailItem" Then
    Set olItem = SendItem
    Set olInsp = olItem.GetInspector
    '// Execute Recall command button
    With olInsp
      .Display
      .CommandBars.FindControl(, 2511).Execute
      .Close olDiscard
    End With
  End If
End Sub

关于vba - Outlook VBA 声明中召回的消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33146033/

相关文章:

email - Outlook 自动发现 SMTP 身份验证

c# - 连接到现有的 Outlook 进程

excel - 根据其他列中的值使用 Excel VBA 创建工作表

vba - 从 VBA 触发计算时,#GETTING_DATA 消息永远不会解析

SQL Access 记录 "Allow multiple value"

excel - 如何在 VBA 中使用 sql 查询并将数据从一个 Excel 工作表获取到另一个工作表?

excel - 根据部分名称查找文件夹

c# - ICAL.NET 重复元素 : Fifth or Last Sunday of every Month

c# - 使用 GetRDOObjectFromOutlookObject 时,兑换邮件对象未正确链接到原始邮件项目

vba - 默认情况下如何在 Outlook 中放置边框圆形图像