How to use the code highlighting plug-in in word2013

Source: Internet
Author: User

the steps to use the code highlighting plug-in are as follows:

Step one: Download the plugin and source code:

Step two: After downloading the file, decompression, Then double-click Binword2010Kong.SyntaxHighlighter.Word2010.vsto or Binword2007Kong.SyntaxHighlighter.Word2007.vsto to complete the installation, assuming that you installed. Net Framework 4.0. After the installation is successful, the following prompts:

Step three: After installing the plug-in, you will have one more ribbon in Word (support word2007 and word2010):

Step four: Click the "Settings" button, pop-up settings interface:

Step five: This simplifies the configuration and removes some of the settings from the previous version.

Step Six: Click the "Insert Code" button to eject the following interface:

Step Seven: You can choose from C #, Java, Xml, JavaScript, and many other languages.

Step eight: In Word the effect is as follows:

Step nine: After posting to the blog, the effect is as follows:

Using System;

Using System.Collections.Generic;

Using System.Linq;

Using System.Text;

Using System.Windows.Forms;

Using Kong.SyntaxHighlighter.Winform;

Using Microsoft.Office.Tools.Ribbon;

Namespace Kong.SyntaxHighlighter.Word


public partial class Ribbon1


private void Ribbon1_load (object sender, Ribbonuieventargs e)





Step Ten: I generated this code in Word, using OL and Li, and set the ol and Li's style, so that in Word can display borders and alternating lines of color, at the same time for OL set a class=codeblock, After posting to the blog, you can use this style name Codeblock to customize your favorite style. The code I generate in Word is probably like this:


      Step 11: So we are in the blog, not set all ol style, fortunately, blog Park articles are in an ID for the cnblogs_post_body under the Div, So I added the following style to my blog:

      #cnblogs_post_body ol


      border:1px dotted #000066;



      Font-family:consolas, Verdana!important;



      Background-color: #E3E3FF;




      #cnblogs_post_body ol font




      #cnblogs_post_body ol li


      Background-color: #fff;


      Border-left:1px solid #8A8AFF;



      #cnblogs_post_body ol li:nth-child (even)


      Background-color: #f5f5f5;


      Step 12: To add, this text is added here:

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.