I have a very weird problem in trying to use the Replace function on the body of a template email. In the email I have a number of special phrases that I replace programatically in vba. e.g. "The captain is zzPlayerNamezz, and he will blah blah". I use the replace function to find and replace the zzPlayerNamezz in a kind of mail merge. This generally works fine but is sometimes very odd. For example If I try to replace "zzPlayerNamezz" it works fine but if try to replace "zzPlayerNamezz," it cannot find it.
the string is "According to our records your child, zzPlayerNamezz, is currently playing..."
the code is :
With MailItem
.htmlbody = Replace(.htmlbody, "zzPlayerNamezz,", "")
If iwere to use .htmlbody = Replace(.htmlbody, "zzPlayerNamezz", "") it works fine
what am I doing wrong??
Bookmarks