Forum Discussion
alex-franco
Jun 22, 2021Copper Contributor
OneNote - Inserting Code Blocks
Are there any plans for a way to format code blocks in OneNote without inserting a 1 column/row table or an ugly print out? The most relevant Google search brings up a post from 2018 where the top an...
nclinch
Iron Contributor
Makes me sad. I would like to have a OneNote for all of our IT documents/Notes and most of the time there is code involved.
I can insert Code into Teams... why not OneNote
I can insert Code into Teams... why not OneNote
WOS-MAnthony
Mar 15, 2024Copper Contributor
nclinch, check this out:
Mac: Format > Styles > Code
Windows: Ribbon > Styles > Code
It's not perfect but it does seemingly remove unnecessary formatting and allow you to paste in and format code blocks.
- JediSQL47Mar 15, 2024Copper ContributorThank you. That does work for a quick and dirty. We'll still need to do the via-Word method if we want to retain the syntax color highlighting. Also, Styles > Code is a paragraph style, so you can't style just a few words within a sentence. I tried via-Word for inline code, and it doesn't work well either.
- WOS-MAnthonyMar 15, 2024Copper Contributor
100% agreed that's it's limited, but it's something. It's a glaring feature absence from OneNote that's borderline inexcusable for a note taking app at this point.