Is it possible to copy code from Visual Studio and paste formatted code to OneNote?

后端 未结 12 1680
时光说笑
时光说笑 2021-01-31 07:53

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

相关标签:
12条回答
  • 2021-01-31 08:41

    There is an add-in for Microsoft Visual Studio that allows you to copy source code, syntax highlighting, and line numbers as HTML.

    With this add-in, you can copy from VS and paste HTML directly to your target.

    Check it out here: CopySourceAsHtml

    0 讨论(0)
  • 2021-01-31 08:41

    The GEM OneNote addon has a syntax highlighting feature -> http://www.onenotegem.com/blog/onenote-insert-highlight-syntax-source-code

    0 讨论(0)
  • 2021-01-31 08:41

    The best way of keeping the format of your code completely is constituted from two steps:

    1. In the first step right click the code and click "copy" then paste it in "wordPad"
    2. In the second step copy from "WordPad" to word.

    0 讨论(0)
  • 2021-01-31 08:43

    For Visual Studio 2008 ---- http://blogs.msdn.com/b/johnguin/archive/2010/11/29/an-addin-to-help-visual-studio-users-with-moving-code-to-onenote.aspx

    0 讨论(0)
  • 2021-01-31 08:43

    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.

    0 讨论(0)
  • 2021-01-31 08:45

    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.

    0 讨论(0)
提交回复
热议问题