Skip to content

Instantly share code, notes, and snippets.

Created August 21, 2013 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/b2f33210d69f5ecafad6 to your computer and use it in GitHub Desktop.
Save anonymous/b2f33210d69f5ecafad6 to your computer and use it in GitHub Desktop.
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