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