我正在尝试找出 Outlook 中撤回邮件的数据类型。
定义邮件项目时,不包括任何撤回消息,因为它们不被视为邮件项目。下面是声明邮件项变量的代码行
Dim msg As Outlook.MailItem
有人知道声明撤回消息的正确方法是什么吗?
最佳答案
要撤回已发送邮件 - 选择“已发送”文件夹中的电子邮件并运行以下命令 vba .
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/