0

I sent an email using Outlook 2010 and after sending the email it was stored in the default Sent Items folder.

I would like to use VBA code to search for a string in the recently sent email and replace the string with a different string.

Can you suggest code that would do it?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Menachem
  • 265
  • 1
  • 4
  • 17
  • 1
    Find & Replace Text - `Item.Body = Replace(Item.Body, "BlaBla", "Replacement text Here")` GoodLuck – 0m3r Dec 06 '15 at 04:54
  • Thanks. How do I get to the recently sent email? This is actually what I did not know how to code correctly. – Menachem Dec 06 '15 at 05:21
  • Possible duplicate of http://stackoverflow.com/questions/34190000/replace-a-string-in-a-sent-email – niton Dec 18 '15 at 03:24
  • if the answer was helpful could you mark accept, Thanks – 0m3r Jul 13 '16 at 04:11

1 Answers1

0

GetDefaultFolder Method

myNamespace.GetDefaultFolder(olFolderSent)

Find & Replace Text -

Item.Body = Replace(Item.Body, "BlaBla", "Replacement text Here")
0m3r
  • 12,286
  • 15
  • 35
  • 71