views:

44

answers:

1

Hey all,

I am trying to find a way to take the syntax highlighted text from N++ and then open it within say MS Word. I have found the plugin NppExport which can save the highlighted text to a rtf file. But it seems N++'s macros are not able to really utilize it. Any suggestions to automate this process? Thanks!

Basic steps are 1) call "Export to RTF" 2) Save to ${FULL_PATH_NAME}.RTF 3) open the RTF file 3) Open MS word

Note: I have 4 figured out using

"C:\Program Files\Microsoft Office\Office12\Winword.exe" /f "$(FULL_CURRENT_PATH)"
A: 

Since you are meshing two programs (Notepad++ and Word). It may be difficult to do totally in the macros. I haven't had much luck with the macros beyond repetitive text manipulation. But I can recommend the tool AutoHotKey (autohotkey.com) which makes implementing these tasks super simple. Here is a little example that I tried out. Yes it works.

^#R::
WinMenuSelectItem , ahk_class Notepad++,,Plugins, NppExport, Copy RTF to clipboard
SetTitleMatchMode, 2  ;find by partial title
WinActivate Microsoft Word
Send ^v

This will copy the text in RTF switch the active window to word and paste the code. It would be relatively simple to change the command to open a new window instead.

Andrew Redd
you can also manipulate Notepad++ menus and do something like Edit > Copy to clipboard > Copy current filename to clipboard.
Andrew Redd