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 .

Picture 1 of Instructions for inserting code in Word

Step 3:

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

Picture 2 of Instructions for inserting code in Word

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

Picture 3 of Instructions for inserting code in Word

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.

Picture 4 of Instructions for inserting code in Word

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.

Picture 5 of Instructions for inserting code in Word

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.

Picture 6 of Instructions for inserting code in Word

Update 19 April 2024
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile