Demonpanda56
Member
- Outlook version
- Outlook 2016 64 bit
- Email Account
- Exchange Server
Hey I was curious about Macros for Outlook 2016 and
kinda wanted to get a bit more lazy but I have a ton of these emails that come in asking for approvals or rejections and I want to be able to approve the selected emails .
Would this code work for that?
Sub ApproveSelectedEmails()
Dim myFolder As Outlook.Folder
Dim myItem As Object
Dim selectedItems As Selection
Set myFolder = Session.Folders("ETSC - TEST").Folders("Inbox")
Set selectedItems = Application.ActiveExplorer.Selection
For Each myItem In selectedItems
If myItem.Class = olMail Then
If InStr(1, myItem.VotingOptions, "Approve") > 0 Then
myItem.VotingResponse = "Approve"
myItem.Send
End If
Next myItem
End Sub
kinda wanted to get a bit more lazy but I have a ton of these emails that come in asking for approvals or rejections and I want to be able to approve the selected emails .
Would this code work for that?
Sub ApproveSelectedEmails()
Dim myFolder As Outlook.Folder
Dim myItem As Object
Dim selectedItems As Selection
Set myFolder = Session.Folders("ETSC - TEST").Folders("Inbox")
Set selectedItems = Application.ActiveExplorer.Selection
For Each myItem In selectedItems
If myItem.Class = olMail Then
If InStr(1, myItem.VotingOptions, "Approve") > 0 Then
myItem.VotingResponse = "Approve"
myItem.Send
End If
Next myItem
End Sub