Instructions for inserting code in Word

To insert code in Word, you cannot use the copy and paste operation as with normal text and 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 Object to display the correct code format in Word. The following article will guide you to insert code in Word.

How to insert code block in Word using Paste Special

Step 1:

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

Step 2:

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

Instructions for inserting code in Word

Step 3:

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

Instructions for inserting code in Word

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

Instructions for inserting code in Word

How to insert code in Word via the Insert tab

Step 1:

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

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 and click on OpenDocument Text and OK.

Instructions for inserting code in Word

Step 3:

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

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

Instructions for inserting code in Word

Leave a Comment

Build a Reusable AutoYaST Profile for SLES 15 Installs

Build a Reusable AutoYaST Profile for SLES 15 Installs

Turn an existing SLES 15 system into a reviewed AutoYaST profile, validate it, and use it to deploy a test server with fewer manual steps.

SLES 15 KVM Setup: Make Selected VMs Start at Boot

SLES 15 KVM Setup: Make Selected VMs Start at Boot

Install the SLES 15 KVM and libvirt tools, enable the right host service, and configure selected virtual machines to start after a reboot.

Diagnose a SUSE Server That Hangs at the systemd Shutdown Screen

Diagnose a SUSE Server That Hangs at the systemd Shutdown Screen

Use systemd jobs and the previous boot journal to locate a slow service, mount, or storage dependency, then correct it without masking the cause.

Open Only the Web Traffic Your SLES 15 Server Needs

Open Only the Web Traffic Your SLES 15 Server Needs

Use firewall-cmd to inspect the active zone, allow HTTP safely, preserve SSH access, and verify that the rule survives a reload on SLES 15.

Diagnose SLES PAM Login Failures Without Locking Yourself Out

Diagnose SLES PAM Login Failures Without Locking Yourself Out

Trace a PAM failure to its service, account policy, or identity provider, then repair the right SLES configuration while preserving a working admin session.

SLES Boot Module Load Failure: Find the Driver and Fix It

SLES Boot Module Load Failure: Find the Driver and Fix It

Trace a failed kernel module at SLES startup, correct an obsolete boot entry or repair the required driver, and verify the next boot.

Set Up DM-Multipath on SLES 15 for Reliable SAN Paths

Set Up DM-Multipath on SLES 15 for Reliable SAN Paths

Prepare SCSI SAN paths, enable multipathd, inspect SUSE’s hardware defaults, and verify stable device maps without guessing array settings.

Clear a Zypper Lock Safely on SUSE Linux Enterprise

Clear a Zypper Lock Safely on SUSE Linux Enterprise

Find the process holding Zypper’s package lock, distinguish process conflicts from package locks, and retry updates without deleting lock files blindly.

Build a Supported SLES 15 HA Cluster with Fencing First

Build a Supported SLES 15 HA Cluster with Fencing First

Register SLE HA, bootstrap SLES 15 nodes, then add fencing, quorum, and tested service resources before relying on failover.

SLES Zypper HTTP 500: Find the Failing Repository

SLES Zypper HTTP 500: Find the Failing Repository

Trace a Zypper refresh error to SUSE, RMT, or a third-party endpoint, then apply the right server-side or cache fix without disabling essential updates.