B
bob c.
I have the following code that works great when I manually start the macro.
What do I have to adjust so I can move it to the "ThisOutlookSession" and
make it work for all new emails received into my inbox ?
Sub ForwardSelectedMessages()
On Error Resume Next
Dim objItem As Object
Dim objForward As Outlook.MailItem
For Each objItem In ActiveExplorer.Selection
If objItem.Class = olMail Then
Set objForward = objItem.Forward
objForward.To = "(e-mail address removed)"
objForward.BCC = "(e-mail address removed)"
objForward.Send
Set objItem = Nothing
Set objForward = Nothing
End If
Next
Set objItem = Nothing
Set objForward = Nothing
End Sub
What do I have to adjust so I can move it to the "ThisOutlookSession" and
make it work for all new emails received into my inbox ?
Sub ForwardSelectedMessages()
On Error Resume Next
Dim objItem As Object
Dim objForward As Outlook.MailItem
For Each objItem In ActiveExplorer.Selection
If objItem.Class = olMail Then
Set objForward = objItem.Forward
objForward.To = "(e-mail address removed)"
objForward.BCC = "(e-mail address removed)"
objForward.Send
Set objItem = Nothing
Set objForward = Nothing
End If
Next
Set objItem = Nothing
Set objForward = Nothing
End Sub