Re: Change subject on forwarded email



You could attach the item to a new message rather than forwarding it. Or, create a new message and put the body of the incoming message into it. (Don't know what you have in mind for the recipient information in that case, though.)

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Graeme Donaldson" <graeme.donaldson@xxxxxxxxx> wrote in message news:1152800121.515130.119820@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thanks Sue, that does work as expected. However, forwarding a message
adds additional text into the body (i.e. Original message sender etc).
I had another look at the actions available in rules and one of them is
redirect the message which would probably work perfectly, however that
appears to take place on the Exchange server only, the MailItem object
doesn't have a Redirect method available.

The only other thing I can think of is to strip the first 18 lines from
the message body (my signature and the additional lines added with
original sender name, etc) on the forwarded message before invoking the
Send method, which will effectively leave me with the original message
body. It's a horrible ugly hack, can you think of a better way though?

Graeme

Sue Mosher [MVP-Outlook] wrote:
You can use a rule with a "run a script" rule action, which takes not an external script but a VBA procedure with a MailItem or MeetingItem as its parameter. That item is processed by the code:


Sub RunAScriptRuleRoutine(MyMail As MailItem)
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim msg As Outlook.MailItem

strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set msg = olNS.GetItemFromID(strID)
' do stuff with msg, e.g.
Set fwd = msg.Forward
fwd.Subject = "new subject"
fwd.To = "someoone@xxxxxxxxxxxxx"
fwd.Send

Set msg = Nothing
Set olNS = Nothing
End Sub

See http://www.outlookcode.com/d/code/zaphtml.htm#ol2002 for another example.


"Graeme Donaldson" <graeme.donaldson@xxxxxxxxx> wrote in message news:1152773587.382977.226680@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi

I need to forward mails from a specific sender to another address,
maintaining the message body but changing the subject. I am not too
familiar with the VBA object model for Outlook as most of the VBA I
work with is in Excel, so I'm not sure where to start.

Incidentally, I thought that there may be a rule I could use that would
allow this but it seems to not be the case.

I am using Outlook 2003.

Can anyone offer some pointers?

Thanks,
Graeme


.



Relevant Pages

  • Re: Complex Outlook rules - programatically?
    ... MsgBox msg.Subject ... Sue Mosher, Outlook MVP ... Set olNS = Application.GetNamespace ... Set msg = olNS.GetItemFromID ...
    (microsoft.public.outlook)
  • Re: Selective Read Receipts VBA using run a script rule
    ... Michael Bauer - MVP Outlook ... Will this display the email address of the sender in the pop up box? ... Set olNS = Application.GetNamespace ... Set Msg = olNS.GetItemFromID ...
    (microsoft.public.outlook.program_vba)
  • Re: Possible to create rule that uses keywords located in a text file?
    ... Another approach would be to use a run a script rule action to use information read in from a file and process the message with that data. ... You'd want to read in the file data just once, when Outlook starts. ... Set olNS = Application.GetNamespace ... Set msg = olNS.GetItemFromID ...
    (microsoft.public.outlook.program_vba)
  • Re: Custom Rules
    ... A "run a script" rule action in Outlook 2002 or later uses a VBA procedure with a MailItem or MeetingItem as its parameter. ... Set olNS = Application.GetNamespace ... Set msg = olNS.GetItemFromID ...
    (microsoft.public.outlook)
  • Re: Email w/ photos wont Send - Why?
    ... Outlook displayed some error message but you chose not to tell us ... Or the recipient got it but the photo ... My guess is that you are forwarding their message inline of your own ...
    (microsoft.public.outlook.general)

Loading