How do i create a template document using Aspose?. For MS Word API, I used to use the following method for the same:
I create an empty document
I open a data source using the below statement:
objDocument.MailMerge.OpenDataSource();
Then I want to let the user create the template (seeing the merge fields).
Hi,
In Aspose.Words you can build a document dynamically using the DocumentBuilder object:
https://docs.aspose.com/words/net/document-builder-overview/
However, I do not fully understand your last task (Then I want to let the user create the template (seeing the merge fields). Could you please provide more details of this process?
Thanks.
Sure.
I need some customizations to the document layout and I want to preserve it. So I saved it as a Custom Word Template (dot file)
When we do : Word 2003 ->New document, it is creating a document using the default word template - Normal.dot (which can be found at : C:\Documents and Settings\Application Data\Microsoft\Templates)
When I create a new document with Aspose.Words with : doc = new Document(), I think it uses the default word template.
I want to know whether Aspose.Words allows me to create a new document from a Custom Template I created?
Thanks
Hi
You can create Document object from DOT file:
//open template
Document doc = new Document(@"Test194\in.dot");
In addition, you can attach template to the document. please see the following link for more information.
https://reference.aspose.com/words/net/aspose.words/document/properties/attachedtemplate
Hope this helps.
Best regards.