double quotes in email message

J

Jim

I am trying to replace the double quotes in an email message.
So if the message is.

I "love" my dog. I want to replace the double quotes. Problem is when I
do mailItem.MessageText.Replace("\"", "##"); for example it does nothing
b/c the double quotes in the message are represented with something like
inverted commas.
Does anyone have any experience with this?
Thanks
 
K

Ken Slovak - [MVP - Outlook]

I forget offhand the ASCII code for those quote characters but you can test
it for yourself. Just get some of that text in a string variable and check
for the ASC value. Then use Chr(x) where x is the ASCII code you discovered
in your Replace call.
 
J

Jim

Thanks Ken, I found out the ASCII values and they were 8220 and 8221 and
then used Replace((char)8220, (char)34); 34 is the ASCII value for "
Thanks again.
 

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