Is there a way to copy code from visual studio (C#) and paste it into OneNote, without losing the formatting?
I was able to do this, but only if I copy from VS, paste to Word, copy from Word, and then paste to OneNote.
Is there a way to copy code from visual studio (C#) and paste it into OneNote, without losing the formatting?
I was able to do this, but only if I copy from VS, paste to Word, copy from Word, and then paste to OneNote.
The best way of keeping the format of your code completely is constituted from two steps:
You have hit the nail on the head on the process. The application that you are pasting to must be able to accept the code with the formatting properly. MS Word is one of the few that handles this properly, therefore, going from VS -> Word -> OneNote will work. But VS -> OneNote doesn't work.
The GEM OneNote addon has a syntax highlighting feature -> http://www.onenotegem.com/blog/onenote-insert-highlight-syntax-source-code
I just figured out a workaround to do this without any plugins.
PS: I have tried in macOS it works fine
Well , sorry for replying late, I know it's very old post. But , it might help to one who is trying to find it out solution for above said question. I found none to work for me even OneNote 2016, but here it is very easy way to do.
Just copy your code and paste it to wordpad.exe it suppose to paste with formatting and colors. Save *.rtf file and open it in Ms Word , from there you can copy/paste any document in word, it worked for me.