Normal development, more or less need to deal with Word, the special change is to edit, export word.
With docx, open source, read-write Word components can quickly help us with word operations.
Docx Official website: http://docx.codeplex.com/
Docx main functions
Inserts, deletes, or replaces text in a document (Word), supporting all standard text formats, such as font {Family,size,color}, out, italic, underline, highlighting, and so on.
Provides paragraph properties that you can set to its orientation, such as left-to-right, center alignment, and so on.
Docx also supports the operation of the picture, hyperlinks, tables, pages, headers, and so on.
The most important point docx supports custom document properties (custom properties)
Recently, to make a change to a SharePoint project, the customer wants to export word for easy printing after the document approval for the escalation (as shown below) is completed. For OA system, this is very important function, customer rush, so need rapid development.
Create Document properties
docx support Load a predetermined template, through the modification of the template can create a new Docx type object, directly invoke the Docx.saveas method can be saved to the specified path, of course, you can also save to a memory stream. Specific powerful features can be referenced docx provide example, written in very detail.
Cut the crap, let's get started. Word2010 (07 uncertain, unused) the above version supports document properties (Doc propery), document properties are a very important feature for developers, you can extend the properties of Word documents, and I use Word 2013 as an example to open Word 2013, click on the top left corner of the file, in the new pop-up page, select the Properties à advanced properties, as follows:
Next, create a new document property, pay attention to an appropriate name, and do not duplicate the existing attributes, for the above image of the complaint approval, you can create the following document properties: