How to Insert Code Snippet in Word




How to Insert Code Snippets with Syntax Highlighting

Paste from Microsoft Visual Studio:
The best method is to simply paste from Visual Studio (or your favorite IDE) into an OpenDocument Text Object in Microsoft Word.

1. Copy the code from your IDE with Ctrl+C.
2. Click the Insert tab at the top, then click the Object button.
3. Scroll down the list and click OpenDocument Text and click OK.
4. Hit Ctrl+V to paste the copied code into the newly opened document. There may be tabbing issues because of the margins. Either edit this in your IDE or choose the offending line, hit Enter to return it and then press Tab to line it up. You can also use the Ruler to guide it into place. To view the ruler, open the View tab at the top and check the Ruler box.
5. After ensuring that everyone looks good, click the X at the top-right to close the OpenDocument Text object and to return to editing your main document.

What’s your favorite programming language? Please let us know in comments.

#HowTech #MicrosoftWord…(read more)


Convert Word 2 PDF: Word to PDF Converter

Convert PowerPoint 2 PDF: PPT to PDF Converter

Convert Excel 2 PDF: Excel to PDF Converter

Convert an Image 2 PDF: Image to PDF Converter

Convert HTML 2 PDF: HTML to PDF Converter

More Tools: PDF Converter