6

When I copy paste from eclipse/RAD to outlook all the text colors and code formatting is preserved just as in RAD 7.5 IDE. But when I copy paste the same to gmail, I am left with no colors. Is this a browser shortcoming or operating systems? I do not know a whole lot about how windows clip board behaves? Any suggestions are greatly appreciated. Thanks !

2
  • When I copy pasted, operating system was windows XP and browser was Firefox 6.0. I tried copy pasting in CKEditor in IE browser I was able to paste after I was prompted to allow access to my clipboard with colors preserved. But CKEditor did not preserve colors on Firefox when I tried the same. Commented Aug 19, 2011 at 21:18
  • 3
    Generally applications store multiple representations of data in the clipboard simultaneously; in this case there might be both HTML and plain text. It is up to the application in question to handle the formats appropriately, so the browser probably does not recognize the HTML format and falls back to the plain text. Commented Aug 19, 2011 at 21:34

4 Answers 4

15

The easiest way is to :

  1. copy your code from eclipse to MS word
  2. copy your code from MS word to gmail

It works for me.

Sign up to request clarification or add additional context in comments.

2 Comments

It also works using LibreOffice Writer instead of MS Word.
Going via LibreOffice Writer also works on Ubuntu, when pasting into Outlook web app.
2

It's not the cleanest way, but I find that if I copy my code from Visual Studio, and paste it into MS Word, then copy it from Word and into Gmail (Chrome) it stays formatted properly. I'm guessing the reason is because Word, upon pasting, is changing the format to HTML, which Chrome can handle just fine.

Comments

0

I'm trying to do the same thing with Visual Studio 2010 and IE9 (both from MS) and it actually works great. However, it doesn't work with any other browser. I think it's a matter of understanding between the IDE and the browser. The IDE puts data in the clipboard with a specific formatting, and the browser is responsible for understanding it. However, if Outlook worked for you, then maybe IE8/9 works too. Just an idea.

Comments

0

Also works in Libre Office and Linux

  1. Copy text from Eclipse
  2. Past to Libre Office-writer
  3. Copy text from Libre Office-writer
  4. Paste to your document, such a blog post or gmail or anything else

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.