Blog
All Blog Posts | Next Post | Previous Post
Color your Delphi source code on the clipboard
Tuesday, April 12, 2011
When writing documentation for your projects, components etc..., source code snippets are indispensable to clarify things. Sadly, when performing a "Copy to clipboard" from the Delphi IDE code editor, this is copied to the Windows clipboard as plain text. Pasting this into MS Word, a CMS or in another webpage editing tool leaves us with dull single-colored text. For years, we then tried to resort to tools like an MS Word macro to reapply syntax coloring, a Javascript library that performs syntax coloring directly on the web page or something like YAPP.Now, wouldn't is be much faster and more convenient if we could, just like in Visual Studio, copy a snippet of code to the clipboard and just past it immediately in MS Word or a web page with syntax coloring applied? We've just released a free plugin for Delphi 2010 or Delphi XE that allows you to do just that.

After installing this IDE plugin, you have two new items in the IDE main Edit menu as well as the editor context menu: Copy as RTF and Copy as HTML. Simply select some source code in the editor and choose "Copy as RTF" and paste in MS Word and you immediately have a syntax colored code snippet in the MS Word document. Or choose "Copy as HTML" and paste in a web document with all Delphi code coloring applied.
Enjoy this free plugin!
Bruno Fierens

This blog post has received 13 comments.

Installation install the .bpl incorrectly, and it fails to load.
Manually installing the .bpl appear to work, and both Copy RTF/HTML appears in the menu. However - no content is copied to the clipboard when activated - but the clipboard is cleared.
Lars Fosdal

Steve Summers


Bruno Fierens

http://www.gexperts.org/tour/index.html?source_export.html
Drennan Allen

delphi 2010 vista 64 bit
Allen Rotton


Bruno Fierens

After installation, starting Delphi XE and getting the "so and so bpl not found, do you want to ... etc" dialog i checked the registry and changed the entry to the correct name.
Stefan

I tried copying with both options and pasting into notepad and it did not do anything. Then I opened MS Word 2007 and pasted it there and it worked.
Stefan


Bruno Fierens

Bruno Fierens

http://stackoverflow.com/questions/2684981/how-to-place-multiple-formats-on-the-clipboard
Lars Fosdal

MB
All Blog Posts | Next Post | Previous Post
Fredrik Loftheim