- Go to Plugins -> NppExport.
- NppExport should be a default plugin. If it is not there, install it using the Plugin Manager.
- Select Copy RTF to clipboard.
- Paste into an application that supports rich-text formatting, such as Microsoft Word, and the code will keep its formatting and color.