outlook macro - Forward eMail (with attachments)

K

KevinC

I am looking for a sample Macro for Outlook. I want to forward the email
received in my account to another account. The forward must be as an
attachment.

PS, I already tried the rules zizard but it does not work. I only forwards
the first email and stops working.
 
S

Sue Mosher [MVP-Outlook]

Sub ForwardIt()
Set objItem = GetCurrentItem()
Set objMsg = Application.CreateItem(olMailItem)

With objMsg
.Attachments.Add objItem, olEmbeddeditem
.Subject = "Forward"
.To = "[email protected]"
.Send
End With

Set objItem = Nothing
Set objMsg = Nothing
End Sub

Function GetCurrentItem() As Object
On Error Resume Next
Select Case TypeName(Application.ActiveWindow)
Case "Explorer"
Set GetCurrentItem =
Application.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set GetCurrentItem = Application.ActiveInspector.CurrentItem
Case Else
' anything else will result in an error, which is
' why we have the error handler above
End Select

Set objApp = Nothing
End Function
 
Top