Step 1 – Insert Object from MS Word’s INSERT menu. Select OBJECT from the drop-down (as opposed to ‘Text from file’).

insert_object

 

Step 2 – You should see an ‘Object’ pop-up – that contains a list of ‘object types’ that you can insert. Select ‘OpenDocument – Text’.

Open_Document_Text

 

Step 3 – That’s it – Now cut and paste your code (from your IDE or wherever) into the OpenText document. When you ‘paste’ it, you can paste ‘with formatting’ so that it looks like code. The resulting object shows up neatly inside your word document – and takes up only as much space as you need it to (you can drag and reduce the size of the embedded document).

This is how my document ended up looking (after inserting some TSQL code).

embedded_code_word

Anuj holds professional certifications in Google Cloud, AWS as well as certifications in Docker and App Performance Tools such as New Relic. He specializes in Cloud Security, Data Encryption and Container Technologies.

Initial Consultation

Anuj Varma – who has written posts on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.