Same problem with Npp 8.7, no colors copied with Nppexport anymore
-
-
can someone with a GitHub account create a new issue there?
github(dot)com/chcg/NPP_ExportPlugin/issues -
@Ch-L .
For me (N++ v8.7, NppExport v0.4) if I use Plugins > NppExport > Export to HTML, the colors work just fine.
Could you be more specific about your problem?
—
update: Running more experiments:
- if I use Plugins > NppExport > Export to RTF, the colors work just fine
- if I use Plugins > NppExport > Export to HTML, the colors work just fine
- if I use Plugins > NppExport > Copy RTF to Clipboard, and paste into Microsoft’s simple WordPad application, the colors work just fine.
- if I use Plugins > NppExport > Copy HTML to Clipboard, and try paste into WordPad, nothing gets pasted (probably because WordPad doesn’t accept data from the “HTML” slot of the Windows clipboard)
- if I use Plugins > NppExport > Copy all formats to Clipboard, and paste into WordPad, the colors work just fine.
- if I use Right Click Context Menu, Plugin Commands > Copy Text with Syntax Highlighting (which is just running Copy all formats to Clipboard), and paste into WordPad, the colors work just fine.
- I used a clipboard-investigating tool to see what the NppExport puts into the clipboard under all those situations, and it’s always valid HTML or RTF with the colors properly embeded (so this confirmed the one I couldn’t paste into WordPad).
- If I use any of the Copy…to Clipboard variants, and try to paste into Microsoft’s “Word” application (their main, fully featured word processor), it honors the bold/italic/underline from the styling, but the colors do not get pasted.
- This appears to be the fault of MS Word, not with Notepad++'s NppExport plugin, because the plugin is putting the right data into the Clipboard, but MS Word is just choosing not to interpret it correctly.
- To help confirm, I created a new document in WordPad, and added bold, italics, underline, foreground color, and background color. When I coped from MS WordPad and pasted into MS Word, it honored the bold, italics, and underline, but ignored the foreground and background colors. The bug (or more likely, “design choice”) is definitely on Word’s side. If, on the other hand, I save the colorful text from WordPad into a file (of type RTF or DOCX or ODT) and open that file from MS Word, then Word properly sees the colors. It appears that Word doesn’t like accepting color from the RTF-slot or HTML-slot of the windows Clipboard
- I just did some searching on the internet: in MS Word, if you want to keep all the formatting, including colors, instead of doing
Ctrl+V
to paste, you have to Right Click, and under Paste Options, you need to pick the one with the paintbrush (which has hover text “Keep Source Formatting (K)
”)
– if you use that Paste Option, then it will paste properly. There’s probably an option somewhere in the MS Word options for changing the default paste-option, but this isn’t a MS Word support forum, so you’ll have to look into that yourself.
As far as I can tell, there is no bug in the NppExport implementation.
If the application you are trying to paste into is not accepting the color from the NppExport clipboard, then try pasting into MS WordPad instead – if it works, then the problem is with whatever other app you were pasting into, not with NppExport; you can try to see if your destintation app has paste options of some sort that will allow keeping the source formatting; or you could save from WordPad and then open the saved file in your other app; or you could just use the Export to HTML or Export to RTF commands, which create a standalone file with the colors and formatting, directly from NppExport.
Good luck.
-
@Ch-L said in Same problem with Npp 8.7, no colors copied with Nppexport anymore:
can someone with a GitHub account create a new issue there?
There was a similar recent issue on the GitHub that was closed due to non-reproducibility and lack of user input and responses:
https://github.com/notepad-plus-plus/notepad-plus-plus/issues/15644 -
Thank you for making this post. I’ve been disappointed that I can’t paste with formatting into Outlook as I used to. After reading your description, I see that Outlook supports the same feature as Word does, so Paste “Keep Source Formatting” works perfectly.
Note that in Outlook, you can press ALT, H, V, K to paste with formatting without using the mouse.
-Ben