【发布时间】:2021-08-23 21:53:23
【问题描述】:
我在网上找到了一个脚本,用于重新发送卡在 Outlook 365 发件箱中的电子邮件。它要求我选择电子邮件。
我有两个帐户,包括一个 Microsoft Exchange 帐户。有什么办法可以修改这个宏,这样当我在 Microsoft Exchange 帐户中发送电子邮件时,所有可能卡在发件箱中的电子邮件都会被自动选中并运行以下宏?
Sub BatchResendEmails()
Dim objSelection As Outlook.Selection
Dim objMail As Outlook.MailItem
Dim objInspector As Outlook.Inspector
Dim objResendMail As Outlook.MailItem
Set objSelection = Application.ActiveExplorer.Selection
If Not (objSelection Is Nothing) Then
On Error Resume Next
For Each objMail In objSelection
objMail.Display
Set objInspector = myItem.GetInspector
'Resend message
objInspector.CommandBars.ExecuteMso ("ResendThisMessage")
Set objResendMail = Application.ActiveInspector.CurrentItem
'You can change the email details as per your needs
With objResendMail
.Subject = objMail.Subject
.Send
End With
objMail.Close olDiscard
Next
End If
End Sub
【问题讨论】: