After analyzing the immanent functionality of Microsoft Word, VBA is used to develop a plug-in of Microsoft Word as a tool to expand the functions of the Microsoft Word in the aspect of the treatment of Word documents to realize automatic typesetting.