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.

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

by Mehmet Emin KARADAĞ | August 25 2015

Visual Studio 2015 için çalışmıyor. Acil düzenleme yapılmalı.. :(

by Anon User456 | April 30 2015

Works as advertised - exactly what i was looking for.

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 KfCalf | 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.

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

  • Copy html
    2 Posts | Last post Thu 10:21 AM
    • I cannot copy html code in Visual Studio 2013. I mean I cannot copy from a file with extension .html. I do not get the option copy as html as in all other code files.
      I would like to copy html snippets in a documentation so I can actually see the html.
    • Thanks for letting me know.
      Does the option appear in the context menu?
      If not, you could try looking for it in the Menu Bar -> Edit menu.
      I will look into it further.
  • Visuatl Studio 2015
    1 Posts | Last post August 13, 2015
    • Have you planned support for Visuatl Studio 2015?
  • Title block with file name / path
    1 Posts | Last post April 22, 2015
    • Could you add an option to put file name or full path into the title block?
  • Visual Studio Express 2013
    2 Posts | Last post April 16, 2015
    • Works on VS Express 2013?
      I've installed it twice, no context menu for Copy to HTML.
    • Add-ins are not supported in Express versions of Visual Studio:
  • Background color option is grayed, and encodings are not really good
    1 Posts | Last post April 05, 2015
    • My settings: I use VS2012 PRO on Windows 7 PRO x64. I have changed background color in VS in code window, to some light brown nuance, in order to have my eyes less tired.
      When I select Copy as HTML, option for background color is grayed, and I cannot change it. Selected color is white. In spite of that, when I paste it on Word 2010 page, I get the background of the text light brown, just like on the code page I copied it from.
      Also non English characters are not those I typed. There are two characters instead of one non English character. So it’s not really WYSIWYG.
      Are there any workarounds about these two problems? Is this because I use Word as a target for paste? Is there some other, preferably Microsoft’s tool for HTML editing (preferably free)?
      Otherwise, I find this Add-In useful for color printing and making documentation, even if I have to do some editing in Word before actual use of pasted text.
  • 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.
1 - 10 of 36 Items