Send code snippets in a message in Teams

Applies to: Microsoft Teams.

To submit a code snippet in a chat or channel message, first press Format Expand button under the compose box, then click Code snippet Code snippet button in the format bar. This brings up a dialogue box, where you can type your code and a snippet title. Pick your preferred language to use, and decide whether you want text wrapping.

Syntax highlighting and auto-indentation aid you to compose your code in your intended format. After you send your snippet, it’s contained in the message as a card, and the recipient can see it inline with the syntax highlighting intact.

If you want to amend your code snippet when you’ve sent it, pick More options More options button > Edit on your message, then Edit Edit button once more on the snippet card.

Leave a Reply

%d bloggers like this: