Option
Explicit
Sub
CopySelectedMailBody2Clipboard()
Dim
objExplorer
As
Outlook.Explorer
Dim
objMailItem
As
Outlook.MailItem
Dim
strMailContent
As
String
Set
objExplorer = ActiveExplorer
If
objExplorer.Selection.Count >= 1
Then
If
TypeOf
objExplorer.Selection(1)
Is
Outlook.MailItem
Then
Set
objMailItem = objExplorer.Selection(1)
If
objMailItem.BodyFormat = olFormatHTML
Then
Select
Case
MsgBox(
"Der EMail-Inhalt liegt im HTML-Format vor."
& vbNewLine & vbNewLine & _
"Möchten Sie den EMail-Inhalt im HTML-Format übernehmen?"
& vbNewLine & _
"(Ja ... HTML / Nein ... Text)"
, _
vbYesNoCancel + vbQuestion)
Case
vbYes
strMailContent = objMailItem.HTMLBody
Case
vbNo
strMailContent = objMailItem.Body
Case
Else
Exit
Sub
End
Select
Else
strMailContent = objMailItem.Body
End
If
With
CreateObject(
"new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}"
)
Call
.SetText(strMailContent)
Call
.PutInClipboard
End
With
Call
MsgBox(
"Der Mail-Inhalt wurde in die Zwischenablage kopiert."
, vbInformation)
Else
Call
MsgBox(
"Keine EMail-Nachricht ausgewählt."
, vbExclamation)
End
If
End
If
End
Sub