Skip to content

Instantly share code, notes, and snippets.

Created August 21, 2013 14:31
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Mass forward selected mails in Outlook. see http://www.epischel.de/wordpress/?p=454
Dim oe
Dim mi
Set myOlApp = WScript.CreateObject("Outlook.Application")
Set oe = myOlApp.ActiveExplorer
If oe.Selection.Count > 0 And oe.CurrentFolder.DefaultItemType = olMailItem Then
For Each item In oe.Selection
REM Set mi = oe.Selection.Item(1)
Dim retValue
retValue = MsgBox("Sent: " & item.Subject, 4)
If retValue = vbYes Then
Set oOMail = item.Forward
On Error Resume Next
With oOMail
.To = "test@example.org"
.Display
.Send
.Close
End With
End If
Next
Else
WScript.echo "Select at least one message."
End If
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment