VehiclesFashionRecipesBlogsHuntTravelsSportFunHandmadeITEducation
Mini-Games
x

x
zakruti.com » IT - Software » Geeks Tutorial
How to Insert Code Snippet in Word

How to Insert Code Snippet in Word

FBTwitterReddit

video description

Rating: 4.0; Vote: 1
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. Whats your favorite programming language? Please let us know in comments
Date: 2023-07-08

Comments and reviews: 5


Thanks for the explanation of opendocument text. One thing that escaped me on watching was how to get out of the embedded document. The video said if we X that out. I couldn't follow what you did. I finally hit the X in the upper right, close window, and all of word minimized, but when I clicked the icon in the taskbar, the main document came back.
reply

One thing to notice is it takes a lot of clicks to create the embedded OpenDocument text. Instead you can record a macro and assign it to a keyboard shortcut. To insert code I simply hit alt-c which runs the macro and ctrl-v to insert the code.
reply

Thank you so much, I got a headache while I was trying to format code with Arabic comments, this technique should work for any mixed left to right and right to left texts
reply

it does not work with long code, ones it reaches the size of a page it does not expands to the next page.
reply

I used the Easy Syntax Highlighter Add-on for MS Word, but the way you suggest it is much better. Thanks!
reply
Add a review, comment






Other channel videos