Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Why, if I copy code from Visual Studio directly into Gmail, all styles are removed but if copied first to Word and then from Word into Gmail then all styles including fonts and color are kept?

share|improve this question

1 Answer 1

Gmail is aware of Word styles. Any styling on text copied from Word is pasted from the clipboard as either Word HTML or RTF if the destination application supports those formats (which Gmail's editor does). Visual Studio's styling isn't copied to the clipboard as Word HTML or RTF, so Gmail's editor will ignore the VS styling. However, Word is aware of VS styling and apparently can convert that styling to Word HTML or RTF when text is copied from VS to Word, copied from Word, then pasted to Gmail.

The best way I know to remove styling from any text is to paste whatever text you want to be plain into notepad, select it, copy it, and paste it again in your final destination.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.