PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Forward Button

Reply

Forward Button

 
Thread Tools Rate Thread
Old 09-08-2004, 03:47 PM   #1
Luis
Guest
 
Posts: n/a
Default Forward Button


Hello.
I receive some mails that i don't need to open but just
forward them to certain persons.
Is it possible to create a custom button to plçace on the
status bar that when i click on it just forward the mail
to a certain email? This cannot be done using a rule
because the subject of the mail determines the target
email and is not a standard subject.

Thanks
  Reply With Quote
Old 09-08-2004, 10:05 PM   #2
=?Utf-8?B?RXJpYyBMZWdhdWx0IFtNVlAgLSBPdXRsb29rXQ==
Guest
 
Posts: n/a
Default RE: Forward Button

Map the following macro below to a custom button. It will forward all
selected e-mails to the address specified in the procedure. It displays the
message rather than auto-sends, but you can change this behaviour - see
inline code comments.

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 = "joeblow@email.com"
objForward.Display
'uncomment to send automatically (comment out objForward.Display
too)
'objForward.Send
Set objItem = Nothing
Set objForward = Nothing
End If
Next
End Sub

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/


"Luis" wrote:

> Hello.
> I receive some mails that i don't need to open but just
> forward them to certain persons.
> Is it possible to create a custom button to plçace on the
> status bar that when i click on it just forward the mail
> to a certain email? This cannot be done using a rule
> because the subject of the mail determines the target
> email and is not a standard subject.
>
> Thanks
>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off