Legaldeejay
Member
- Outlook version
- Outlook 2019 64-bit
- Email Account
- POP3
I found a script online which will allow me to resend emails stuck in the Outbox in Outlook 365. But it requires that I actually go the Outbox folder and select the emails in the Outbox. Is there any way to modify this macro so that when I run it, it will automatically select all emails in the Outbox and apply it? Thanks. This is the VBA script:
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
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