/code
In Notion
Adds a code block with syntax colors.
Where you type it
In any Notion page (type / on a new line or in a block).
Add
Paste your code, then pick the language.
Example
/code
Press Esc to close the / menu if you just want to type a slash. A real command built into Notion, checked against its own help pages in November 2026. Official help page
In Teams
Inserts a code block in your message.
Where you type it
In message box.
Before you start: Teams desktop app only. Your organization can turn some commands off.
Add
Paste your code.
Example
/code
Microsoft says built-in slash commands work only in Teams desktop. Most work in the message box; /chat works only in the search bar. A real command built into Teams, checked against its own help pages in November 2026. Official help page