Retrieve colors assigned by Notepad++
tocardinho
Posted messages
11
Status
Member
-
Zac -
Zac -
Hello,
I know this topic isn't strictly programming itself, but you're the most qualified to help me.
I am a student, and I need to write an internship report, and I would like to copy and paste my code (Notepad++) into my report (Word) while keeping the colors assigned to the PHP code by Notepad++. Otherwise, it's very unpleasant to read.
If anyone has needed to do this before and has a solution, thank you!
I know this topic isn't strictly programming itself, but you're the most qualified to help me.
I am a student, and I need to write an internship report, and I would like to copy and paste my code (Notepad++) into my report (Word) while keeping the colors assigned to the PHP code by Notepad++. Otherwise, it's very unpleasant to read.
If anyone has needed to do this before and has a solution, thank you!
Configuration: Windows XP Firefox 3.0.1
6 answers
I’m arriving after the battle, but if it can help someone:
Menu Plugins/NppExport/Copy RTF to clipboard.
All that's left is to paste it into Word.
Good evening.
Menu Plugins/NppExport/Copy RTF to clipboard.
All that's left is to paste it into Word.
Good evening.
bijnok
You can create a macro in Notepad++ using this method; it makes things easier when you have to repeat the copy-paste, for a report for example...
Zac
And I arrive after the post-war reconstruction lol, your response 9 years later was very helpful to me, thank you.
Another solution:
in Npp, press ctrl+A (to select all the source code of your program)
then click on the menu: "TextFx" then "TextFx Tools" then "insert line numbers" (respectively: "delete line numbers to remove these inserted lines" or you can also press ctrl+z to undo.
then you copy it with export to all formats into a Word file.
If you do not want 4 or 5 digit numbers containing a 0: you go to edit\replace 00000 with nothing (put 5 zeros for code going beyond a hundred lines, if it’s less put 6 zeros); the code will be cleaner for display.
there you go, there you have it
test
in Npp, press ctrl+A (to select all the source code of your program)
then click on the menu: "TextFx" then "TextFx Tools" then "insert line numbers" (respectively: "delete line numbers to remove these inserted lines" or you can also press ctrl+z to undo.
then you copy it with export to all formats into a Word file.
If you do not want 4 or 5 digit numbers containing a 0: you go to edit\replace 00000 with nothing (put 5 zeros for code going beyond a hundred lines, if it’s less put 6 zeros); the code will be cleaner for display.
there you go, there you have it
test
I am also looking to copy line numbers. I haven't found a way, but otherwise, we can do the following:
If it's to paste into Word: you need to:
Just before a paragraph (in Word), create a section break (continuous section break).
Right after, do the same, section break.
Double-click on the section break to open the layout menu, and there you have the option to number the lines of the section you just defined.
30 seconds top clock, and it works.
All that's left is to paste what we copied from Notepad++.
It's not the best solution, but it's a workaround. If anyone has a better one.
Thank you
++
If it's to paste into Word: you need to:
Just before a paragraph (in Word), create a section break (continuous section break).
Right after, do the same, section break.
Double-click on the section break to open the layout menu, and there you have the option to number the lines of the section you just defined.
30 seconds top clock, and it works.
All that's left is to paste what we copied from Notepad++.
It's not the best solution, but it's a workaround. If anyone has a better one.
Thank you
++
To simplify the pasting of line numbers in Word, we can also create a template (layout template). To avoid repeating the procedure of section break + adding line numbers multiple times.
We create once in a new Word file 2 section breaks and insert the line numbers there.
Thus, as soon as we have snippets of code from Npp, we just need to copy-paste this template into our original Word file and then paste the Npp code.
Nota Bene: Npp stands for Notepad++
++
test
We create once in a new Word file 2 section breaks and insert the line numbers there.
Thus, as soon as we have snippets of code from Npp, we just need to copy-paste this template into our original Word file and then paste the Npp code.
Nota Bene: Npp stands for Notepad++
++
test
Good evening,
I’m afraid that’s not possible. Notepad++ has a parser that detects keywords and the inherent structures of each language in order to apply syntax highlighting.
This is not the case with Word, and you will lose this information, which is not stored in the files but calculated directly by the editor.
--
blogfrisbee dot blogspot dot com
I’m afraid that’s not possible. Notepad++ has a parser that detects keywords and the inherent structures of each language in order to apply syntax highlighting.
This is not the case with Word, and you will lose this information, which is not stored in the files but calculated directly by the editor.
--
blogfrisbee dot blogspot dot com