You can see before formatting the entire text was in black and the font was Calibri.
After auto formatting the keywords has been changed to blue color and the font has been changed to Courier.
You can do this just using a simple plugin. You will get a ready made .exe file which you need to install.
After installation open MS Word and you will find the plugin in the Add-Ins tab of MS Word.
How to do it ?
- Go to this website, and download the compiled Word add-in (ready to install and use).
- Download the .exe and install it.
- After installation open MS Word and write any programming code such as VB, C, C++, C#, JAVA, PERL, PHP, Pascal and DFM Files.
- Presently it supports above programming languages.
- Select the text which you want to format, set the type of programming language you are using from the drop down menu and then press the formatting button to format. The same has been shown in the following diagram.
A similar article you may also read “How to create an HTML editor with just 10 lines“.