We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Modifying existing Word templates

I’ve downloaded the evaluation copy of aspose.words to determine if I can use it for a mail merge type application.


Basically I need to open several existing Word templates in .docx format, insert data into several fields and insert several tables in between the existing text of the templates. Nothing in the programming guides that I’ve seen at a first glance is helping me beyond being able to open and save the documents. For example how I insert text in specific areas of the existing template. Can you please point me in a direction so I can proceed with my evaluation? Thanks.

Hi Stephen,


Thanks for your inquiry.

First of all, please note that Aspose.Words is quite different from the Microsoft Word’s Object Model in that it represents the document as a tree of objects more like an XML DOM tree. If you worked with any XML DOM library you will find it is easy to understand and work with Aspose.Words. When you load a Word document into Aspose.Words, it builds its DOM and all document elements and formatting are simply loaded into memory. Please read the following articles for more information on DOM:
http://www.aspose.com/docs/display/wordsnet/Object+Model+Overview
http://www.aspose.com/docs/display/wordsnet/Composition+Diagrams

DocumentBuilder is a powerful class that is associated with a Document and allows dynamic document building from scratch or the addition of new elements to an existing document. It provides methods to insert text, paragraphs, lists, tables, images and other contents, specification of font, paragraph, and section formatting, and other things. Please read following documentation links for your kind reference.
http://www.aspose.com/docs/display/wordsnet/DocumentBuilder+Overview
http://www.aspose.com/docs/display/wordsnet/Inserting+Document+Elements
http://www.aspose.com/docs/display/wordsnet/Moving+the+Cursor

Regarding mail merge, please read How to Execute Simple Mail Merge. Hope this answers your query. Please let us know if you have any more queries.


Got it, thanks Tahir