Instructions for inserting code in Word

To insert code in Word, you cannot use copy and paste as with normal text or documents, but need to use the Paste Special option or insert as an object.

To insert code in Word, you cannot use copy and paste as with normal text or documents, but need to use the Paste Special option or insert as an object. We will need to paste the code block inserted in Word as HTML or insert an Object to display the correct code format in Word. The article below will guide you to insert code in Word.

How to insert code blocks in Word using Paste Special

Step 1:

You open a Word document and want to insert a block of code into the interface. Next, copy the block of code you want to use as usual.

Step 2:

Return to the Word document, click on the Home tab and then look down below, in the Paste tool, select Paste Special .

Instructions for inserting code in Word Picture 1Instructions for inserting code in Word Picture 1

Step 3:

Displaying the content paste option, click on HTML format and then click OK to paste the code into the Word document.

Instructions for inserting code in Word Picture 2Instructions for inserting code in Word Picture 2

Immediately after that you will see the code inserted in Word as shown below.

Instructions for inserting code in Word Picture 3Instructions for inserting code in Word Picture 3

How to insert code in Word via the Insert tab

Step 1:

On the Word interface, click the Insert tab to insert the object. Then, look down at the Text group and select Object and then click Object in the drop-down list.

Instructions for inserting code in Word Picture 4Instructions for inserting code in Word Picture 4

Step 2:

Displays the interface for selecting the type of object you want to insert into Word. Click on the Create New tab then look down below and click on OpenDocument Text and OK.

Instructions for inserting code in Word Picture 5Instructions for inserting code in Word Picture 5

Step 3:

Now a Word document is opened and you also click on the Home tab and then Paste and select Paste Special . Next we select the HTML format and click OK to paste the code . Then you close this newly opened Word document without saving it .

Go back to the Word document and insert the code and you will immediately see the code as shown below.

Instructions for inserting code in Word Picture 6Instructions for inserting code in Word Picture 6

4 ★ | 2 Vote