Copying text with color from Notepad++

Is there a way to copy the text from a Notepad ++ file with color?

I am trying to write a tutorial document, and I would to be able to copy the xml tags.

Thanks!

82435 次浏览

There's a plugin called NppExport that does just that in a couple of available formats. If you don't have NppExport yet, you can download it through the inbuilt plugin manager.

update As of version 6.1.5 (or maybe earlier) this ships with a standard install of Notepad++

enter image description here

update As of 2019 NppExport is not included by default in the Notepad++ 64 bits version (github issue). You can download the 64 bits version of NppExport here: [github]

To built on Raveren answer : Copy HTML to clipboard didn't for me (for a .bat), I had to select plugins/NppExport/Export to HTML instead and then open the html in a browser and copy the text from there.

For copying .bat file contents, simply choose the 'Copy all formats to Clipboard' Option.

In NPP v6.7.7 you can do this by selecting your text, right clicking on it, select "Plugin commands" and then "Copy text with syntax highlighting".

It works fine when you choose copy with right click plugin commands and copy text with syntax highlighted.

For Notepad++ 64-bit releases you can find the NppExport plugin here: https://github.com/chcg/NPP_ExportPlugin/releases

I've tested "NppExport_0.2.8.16_x64.zip" with Notepad++ v7.5.4.

I have downloaded plugin Manager from https://github.com/bruderstein/nppPluginManager/releases. It contains Plugin Manager DLL and an EXE. Copy paste PluginManager.dll into C:\Program Files\Notepad++\plugins and Copy paste gpup.exe into C:\Program Files\Notepad++\updater. If you dont have updater folder, create one. Restart notepad ++. Under Plugins-->YOu will notice Plugin Manager. Use this to install Plugins. The one I installed is NppExport. This is very use full.

The easiest way worked for me is:

  1. Print your contents from npp++ to pdf by using microsoft print to pdf tool ( It will retain all the formatting and color code in pdf).

    1. Open that pdf file by using Microsoft Word and it will ask you the confirmation for conversion to word, convert it.

    2. If you want to make changes to the file just save save as the file with 'save as' option and that's it.