PDA

View Full Version : Find and Replace in message Body



ArjunW
02-11-2012, 02:17 PM
hi,
Iam searching for a vb code to find and replace specific words in every outgoing mail in outlook 2007.
Also to note that every outgoing mail might not contain those specific words.Will probably need an "IF" condition.
I would really appreciate it if someone could help me out on this.
If this query has been discussed earlier i would be glad to check that particular posting.
Regards
Arjun

JP2112
02-23-2012, 02:06 PM
Check out the ItemSend Event (http://msdn.microsoft.com/en-us/library/aa171284(v=office.11).aspx).

ArjunW
02-23-2012, 02:23 PM
@jp thanks for the tip ,The itemsend event is the event ,when the mail is about to be sent.Iam trying to figure out how to find and replace words in the body of the mail being sent during the itemsend event..!!

skatonni
04-02-2012, 06:29 PM
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Item.HTMLBody = Replace(Item.HTMLBody, "test", "hello")
End Sub