Copying text with color from Notepad++
TextColorsCopyNotepad++Text Problem Overview
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!
Text Solutions
Solution 1 - Text
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++
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]
Solution 2 - Text
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".
Solution 3 - Text
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.
Solution 4 - Text
It works fine when you choose copy with right click plugin commands and copy text with syntax highlighted.
Solution 5 - Text
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.
Solution 6 - Text
For copying .bat file contents, simply choose the 'Copy all formats to Clipboard' Option.
Solution 7 - Text
The easiest way worked for me is:
-
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).
-
Open that pdf file by using Microsoft Word and it will ask you the confirmation for conversion to word, convert it.
-
If you want to make changes to the file just save save as the file with 'save as' option and that's it.
Solution 8 - Text
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.