/gist:b2f33210d69f5ecafad6 Secret
Created
August 21, 2013 14:31
Star
You must be signed in to star a gist
Mass forward selected mails in Outlook. see http://www.epischel.de/wordpress/?p=454
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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