Code to Rename E-mails

A

Andibevan

Hi All,

I receive a large number of e-mails that are forwarded from my work e-mail
address. These always have the same format and the subject is FORWARDED
MAIL. This is difficult as I have hundreds of e-mails with the subject
Forwarded MAIL.

I intend on creating code that will search the e-mail for a standard header
(created when the mail is autoforwarded) and then rename the e-mail based on
the information found.

I can't find any help on how to programatically rename e-mails?

Is it also possible to change who the sender was of a stored e-mail?

Any help or pointers would be appreciated.

Thanks

Andy
 
M

Michael Bauer

Am Sat, 17 Dec 2005 17:16:27 -0000 schrieb Andibevan:

Andy, for re-naming just change the e-mail´s subject.

Changing the sender isn´t possible via the Outlook object model. Instead you
need to use CDO or Redemption (www.dimastr.com). With Redemption´s RDOMail
object it´s very easy to access the Sender* properties.
 
A

Andibevan

I am trying like this, but it doesn't seem to work:-

Sub Cycle_Through_and_Change_Contents_Of_Personal_Folder()
Dim objFolder As Outlook.MAPIFolder
Set objFolder = GetFolder("Personal Folders/Forwarded Mail")
Dim Item As Object 'e-mail
Dim Result As String

'MsgBox objFolder.Items.Count

'character 13 character 10
For Each Item In objFolder.Items

' MsgBox Item.Subject
' MsgBox Item.Body
'MsgBox (Item.Body)
'Result = Extract_Characters(Item.Body)

Result = Extract_Subject(Item.Body)
MsgBox ("Current Subject: " & Item.Subject & vbLf & Result)
Item.Subject = Result
'Item.Subject = Extract_Subject(Item.Body)
Next

End Sub
 
A

Andibevan

I got it!! - Missing the .save bit.

Thanks

Andibevan said:
I am trying like this, but it doesn't seem to work:-

Sub Cycle_Through_and_Change_Contents_Of_Personal_Folder()
Dim objFolder As Outlook.MAPIFolder
Set objFolder = GetFolder("Personal Folders/Forwarded Mail")
Dim Item As Object 'e-mail
Dim Result As String

'MsgBox objFolder.Items.Count

'character 13 character 10
For Each Item In objFolder.Items

' MsgBox Item.Subject
' MsgBox Item.Body
'MsgBox (Item.Body)
'Result = Extract_Characters(Item.Body)

Result = Extract_Subject(Item.Body)
MsgBox ("Current Subject: " & Item.Subject & vbLf & Result)
Item.Subject = Result
'Item.Subject = Extract_Subject(Item.Body)
Next

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top