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. 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 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 2

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

Instructions 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 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 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 6

4 ★ | 2 Vote

May be interested

  • Learn about Section in Microsoft Word 2010Learn about Section in Microsoft Word 2010
    in the tutorial article below, we will introduce you to some of the basic features of the section in the microsoft word 2010 application. dividing and inserting a section into a word document is an extremely useful solution. if you have to do some things like this ...
  • Instructions for inserting text into images in Word - Design banners, greeting cards,...Instructions for inserting text into images in Word - Design banners, greeting cards,...
    to create a highlight for an image, or need to present something more unique, you can insert text into the image in word.
  • How to create word art in WordHow to create word art in Word
    sometimes reading plain text is just a simple font that will be boring and not create accents in your text. therefore, i introduce to you the tool for inserting artistic words in word.
  • Align text, adjust font in Word 2013Align text, adjust font in Word 2013
    text format aims to attract the reader's attention to specific parts of the document and emphasize important information in it. in word 2013 , you have many options for editing text, including fonts, font colors, and inserting special symbols.
  • Instructions for inserting Math formulas in Word 2016Instructions for inserting Math formulas in Word 2016
    in micorsoft word 2016 version to be able to insert the math formula, in addition to performing in the traditional way, we can also use a completely new formula.
  • How to insert a signature in WordHow to insert a signature in Word
    when inserting a digital signature into word, the document will not be copied and verified as the owner when the content cannot be edited.
  • Code Snippet in VS 2005Code Snippet in VS 2005
    one of the most prominent features in vs2005 is the use of code snippet. this is a utility that helps develop applications faster by automatically inserting the commonly used program code into the editing environment, so that the programmer will be able to
  • How to add color coded terminal code to Microsoft WordHow to add color coded terminal code to Microsoft Word
    if you want to set the correct color code for terminal code in word, only copying and pasting will not work. you will need to use the tool to create color-coded html, then enter html into word.
  • Instructions for inserting Youtube videos into PowerPointInstructions for inserting Youtube videos into PowerPoint
    if you need a video on youtube that appears in the presentation, this is the guide you need.
  • How to insert a signature into Word 2010, 2013, 2016, 2019, 2020How to insert a signature into Word 2010, 2013, 2016, 2019, 2020
    inserting a signature into word helps confirm the legitimacy and copyright of the document. you can use the signature line function in word to add handwritten or digital signatures to documents, creating professional and trustworthy documents for work or legal transactions.