question

Brian-7574 avatar image
0 Votes"
Brian-7574 asked YijingSun-MSFT commented

Formatting from Microsoft Word to TextBox to Email - apostrophes show up as questoin marks

I'm working on a web forms app that allows users to enter text into an asp:TextBox , click submit and send the text as email. It works great, unless users first enter text into Microsoft Word and copy and paste into the TextBox and then send the email. When users do this, apostrophes and some other characters can show up as question marks (when the email is received). Any recommendations on how to fix?

dotnet-aspnet-webforms
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

YijingSun-MSFT avatar image
1 Vote"
YijingSun-MSFT answered YijingSun-MSFT commented

Hi @Brian-7574 ,
As far as I think, you need to change your text to 'Plain text' before pasting into the HTML document. I think there are two ways:

  1. Copy the text from MS Word to Notepad, and then from Notepad to word (you'll loose all the formats that were made in word, but will keep the text;

  2. Use an RTE (Rich Text Editor) like CKEditor instead of a textbox, since it clears MS Word strange tags;

Best regards,
Yijing Sun


If the answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our  documentation  to enable e-mail notifications if you want to receive the related email notification for this thread.

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for the reply.

When I tried #1, it still kept the formatting.

Using a RTE may be my best bet.

An alternative may also be replacing the common characters such as: .Replace("’", "'")

0 Votes 0 ·

Hi @Brian-7574 ,
Because you said, you copy and paste the text from MS Word to the textbox. It should only use the keyboard. So, I suggest you could use the RTE. How do you use the Replace() method when you paste the text?

Best regards,
Yijing Sun

0 Votes 0 ·

To clarify my original post, the question marks don't show up in the textbox, but they do show up in the email that is sent. So when users click submit to send the email, that's when I would replace the textbox characters. I'll look more into using an RTE now and see how that works with email formatting. Thanks for the suggestions!

0 Votes 0 ·
Show more comments