Consulting

Results 1 to 4 of 4

Thread: Find and Replace in message Body

  1. #1
    VBAX Newbie
    Joined
    Feb 2012
    Posts
    2
    Location

    Find and Replace in message Body

    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

  2. #2
    VBAX Expert JP2112's Avatar
    Joined
    Oct 2008
    Location
    Astoria, NY
    Posts
    590
    Location
    Check out the ItemSend Event.
    Regards,
    JP

    Read the FAQ
    Getting free help on the web
    My website
    Please use [vba][/vba] tags when posting code

  3. #3
    VBAX Newbie
    Joined
    Feb 2012
    Posts
    2
    Location
    @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..!!

  4. #4
    VBAX Mentor skatonni's Avatar
    Joined
    Jun 2006
    Posts
    347
    Location
    [VBA]Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Item.HTMLBody = Replace(Item.HTMLBody, "test", "hello")
    End Sub[/VBA]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •