By pasting formatted text in Word and OneNote both applications act a little bit different. Meanwhile Word supports RTF-formatting OneNote does not.
OneNote could only handle HTML-formatting.
In combination with presenting source code for Visual Studio the Add-in CopySourceAsHtml is available.
During copying with Edit > Copy As HTML some option must set – notably Include RTF should be deactivated:
