-
-
Save anonymous/68f74fe8c829c4e3ddbc to your computer and use it in GitHub Desktop.
Copy current message in Outlook into Windows clipboard
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 | |
Dim strMH | |
Set myOlApp = WScript.CreateObject("Outlook.Application") | |
Set oe = myOlApp.ActiveExplorer | |
If oe.Selection.Count = 1 And oe.CurrentFolder.DefaultItemType = olMailItem Then | |
Set mi = oe.Selection.Item(1) | |
strMH = "From:" & vbTab & mi.SenderName & vbCrLf & _ | |
"Sent:" & vbTab & mi.SentOn & vbCrLf & _ | |
"To:" & vbTab & mi.To & vbCrLf & _ | |
"Cc:" & vbTab & mi.Cc & vbCrLf & _ | |
"Sub:" & vbTab & mi.Subject & vbCrLf & vbCrLf | |
Set objIE = CreateObject("InternetExplorer.Application") | |
objIE.Navigate("about:blank") | |
objIE.document.parentwindow.clipboardData.SetData "text", strMH & mi.Body | |
objIE.Quit | |
WScript.echo "Nachricht im Clipboard: " & mi.subject | |
Else | |
WScript.echo "Select one and ONLY one message." | |
End If |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment