Copy As HTML


Copy selected code in HTML format while preserving syntax highlighting, indentation, background colour and font. Options: Max Height, Title Block, Alternating Lines, Line Numbers, Wrap Lines, Un-indent, Background Colour, Class Names. Converts RTF, outputted by VS, into HTML.

(24) Review
Visual Studio
2013, 2012, 2010, 2008, 2005
Download (24,829)
E-mail Twitter Digg Facebook
Add to favorites
Reviews (24)
Q and A (31)
Sign in to write a review
Sort by:

by oxygens | January 14 2015

Strange characters appear for code indented with tabs.
Source code copied while VS is in dark mode theme looks like crap.

by deap82 | November 12 2014

I have successfully used this trick to make the extension work in vs 2013:

by azoolaj | September 06 2014

by edspace1 | January 28 2014

Please, can you add support for VS2013?

by Guangchun | December 13 2013

Could you please add support for VS2013? Thanks.

by Jon M Curtis | July 31 2013

Did not work to copy from Visual Studio 2012 to OneNote. It added stray characters to whitespace, e.g. '    def __init__(self, data): pass'. I assume that's a defect that will be fixed. But the reason I immediately uninstalled it is because it brings up a settings dialog on every copy operation, and it does not remember the previous settings. So you have to uncheck what you don't want (e.g. line numbers added) every time you do a copy. It would be better if the settings were made seperately instead of having the extra dialog appear every time you want to copy/paste.

by SWheaties | July 07 2013

This is a very nice tool, thank you very much for publishing it.
Is there a way to omit the line numbers from the html such that the user can highlight the code in the html page, copy it, and paste it into visual studio without modification?

Thank you,


by calf__ | January 21 2013

This tool is very cool,but there is some problem with me~
My vs is Visual Studio 2010(chs),i can not find it in context menu or "Menubar –> Edit" after install

by rahman_mahmoodi | July 14 2012

This is excellent. Love it!!! Keep on the good job!!!

by Özgür SARI | June 28 2012

I really liked this...

by _Witek_ | June 07 2012

Works nicely. It would be useful to be able to add custom title instead of the default Code Snippet.

by Dragan Radovac | April 16 2012

by Patrick Butler Monterde | February 28 2012

Great Application. I would love to see the ability to change the font type in the tool.

by Daniel Kreuzhofer - Consultant | January 15 2012

Great tool. Very simple and just working!

by Patrick Layani | November 17 2011

nice work. very simple to install and use, and do the work perfectly.

by zedubal | October 19 2011

Very nice!

by Jens Vestergaard | September 19 2011

This is a really nice and well done tool.
It's on the top 3 list of tools I install right after Visual Studio is installed on a new computer.
Great job!

by Jason R. Shaver (MSFT) | September 07 2011

Works great, I only wish there was a way to make it the default 'copy' and to have it skip the dialog.

by David Ballantyne | October 12 2010

For anyone who has to write developer documentation, this tool is a must and will save you literally hundreds of hours.

Excellent tool.



by Owen1980 | July 05 2010

1 - 20 of 24 Items   
Sign in to start a discussion

  • The parameter is incorrect error
    2 Posts | Last post March 11, 2015
    • Hi, would like to report a problem.
      Just installed the plug-in. If I use "Copy as HTML source" option, I got an error "The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))".
      If I don't use "Copy as HTML source", it works fine.
      Visual Studio 2012.
    • I've improved the option.
  • "Â" in the pasted text
    3 Posts | Last post March 11, 2015
    • Hi, Thanks for excellent tool!
      I think I may have some kind of encoding issue.
      Code Snippet
      72.	<div>
      73.	Â Â Â Â <span>
      74.	Â Â Â Â Â Â Â Â <asp:Label ID="Label5" runat="server" Text="Date of Birth:" AssociatedControlID="DOB"></asp:Label>
      75.	Â Â Â Â </span>
      76.	Â Â Â Â <div class="answerList">
      77.	Â Â Â Â Â Â Â Â <asp:TextBox runat="server" ID="DOB"></asp:TextBox>
      78.	Â Â Â Â Â Â Â Â <span>DD/MM/YYYY</span>
      79.	Â Â Â Â </div>
      What's all the Â? I think something is messing with the encoding, I'm copying over RDP from VS2010/win2008r2 with Copy as HTML into Word 2010/xp.
      I found your tool and used it quite happily on a different system, but found this on a vs2012/windows8 laptop I was trying out, so I was surprised to find it on a more widepread platform.
      Any ideas about where to start sorting this out?
    • Hi David,
      Thanks for the compliments and for letting me know about the problem. A few people have reported it. It works fine on a lot of systems but not on others. Unfortunately I don’t currently have access to VS2012 so I can’t fix it.
      As you suggest it could be a problem with the encoding. I’ve encoded the NBSP as \xa0. May be it should be \x00a0 or convert it to HTML character entities &#160; or &#nbsp; .
      Would anyone be willing to have a look at it? I could send you the source code.
      And people have made good suggestions for improvement so anyone who wants to code them is welcome?
    • I've updated the Addin for VS2103. I've changed the indent character to &#160;
      I've also made a few other improvements such as font preservation.
  • VS 2013?
    2 Posts | Last post March 11, 2015
    • Any idea when this will work on 2013? Or what the steps would be to see if it will work on 2013?
    • I've updated the installer for VS2013 with a few other improvements such as font preservation.
  • Making it work in VS 2013
    2 Posts | Last post March 11, 2015
    • I have successfully used this trick to make the extension work in vs 2013:
    • I've updated the installer for VS2013 with a few other improvements such as font preservation.
  • Can't turn off line numbers
    4 Posts | Last post March 11, 2015
    • Hi Tim:
      Even when I uncheck the box for "Line Numbers", the tool still inserts them in the copy, with the line numbers inserted to the left of the margin in the target.
      Can this be fixed?
      Noel C. Gordon
    • Hi Noel,
      Thanks for letting me know about that problem.
      As a quick workaround, try deselecting “Alternating Lines” as well as deselecting “Line Numbers”, but you will loose alternating lines.
      A more complex fix which would allow to keep alternating lines is to select “Use Class Names” and type “le-cah-container-no-numbers” for the “Container” then define the following rule in the stylesheet:
      .le-cah-container-no-numbers li
           list-style-image:  none;
           list-style-position:  outside;
           list-style-type:  none;
      Ideally I need to improve the programme logic, but I don’t currently have access to VS2012.
      Hope that helps,
    • Here is the complete stylesheet. I’ve capitalised the rules needed to remove the line numbers. You can customise the other rules to suit.
      	background: #000080;
      	color: #ffffff;
      	font-family: Verdana, Tahoma, Arial, sans-serif;
      	font-size: 10pt;
      	font-weight: bold;
      	padding: 2px 5px;
      .le-cah-container-no-numbers ol
      	border: #000080 1px solid;
      	color: #000000;
      	font-family: Consolas, 'Courier New', Courier, Monospace;
      	font-size: 10pt;
      	MARGIN: 0;
      	PADDING: 0;
      .le-cah-container-no-numbers li
      	list-style-image: none;
      	list-style-position: outside;
      	margin: 0;
      	padding: 2px 5px;
    • I've updated the Addin code now.
  • Live Writer Paste from Visual Studio Plugin
    2 Posts | Last post March 11, 2015
    • It looks like the plugins for Live Writer have been discontinued, as the link redirects to Outlook online.  Is the plugin available elsewhere?
    • Yes. It's on my website.
      Paste as Visual Studio Code for Windows Live Writer:
  • BUG: no spaces between type name and identifier
    2 Posts | Last post December 05, 2014
    • A simple code:
      var a = 0;
      will be formatted to:
      vara = 0;
      see below source code.
      <div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
      <div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px">Code Snippet</div>
      <div style="background: #fff; max-height: 300px; overflow: auto">
      <ol start="77" style="background: #ffffff; margin: 0; padding: 0 0 0 5px;">
      <li><span style="background:#ffffff;color:#0000ff">var</span><span style="background:#ffffff;color:#000000"> </span><span style="background:#ffffff;color:#000080">a</span><span style="background:#ffffff;color:#000000"> = 0;</span></li>
    • False alarm, it is my blog system's problem
  • VS2012 Ultimate No Right Click Context Menu Entry
    3 Posts | Last post October 09, 2013
    • I've installed your tool and uninstalled it about half a dozen times now. I can see the assemblies on the disk in the appropriate places, but I do not get a right click context menu entry. Any ideas what to try next? I do have Resharper installed, so the context menu is already 'large'.
    • After installation, the tool does not appear in the Extensions and Updates dialog as an installed tool.
    • I developed it for the Professional edition of Visual Studio. Microsoft does things a little differently in the other editions so it might not work with these.
  • Visual Studio 2012 Version?
    2 Posts | Last post August 30, 2013
    • This tool looks awesome. I would love to use it but I work in Visual Studio 2012. Do you happen to have any plans to make it available for 2012? Thanks!
    • its working in 2012
  • Possibility of removing #160 characters?
    1 Posts | Last post June 26, 2013
    • Hi, I think addin would be _the_ solution I'm looking for in copying scripts to OneNote with syntax highlighting.  The problem is that the NBSP (#160) character breaks SSMS when you try to run a script with that character in it.
      Any chance of having an option to use an actual space character, instead of the NBSP one, in the HTML copied?
1 - 10 of 31 Items