How to create an empty document


#1

Hi,

I just downloaded Aspose.Word for evaluation purposes. No I am wondering that there is no function to create an empty document. Are there any plans to do that, because this is essential for my application. It is also not possible to save the opened (precreated) document with a new filename. Is this a bug or a missing feature ? I am using Aspose.Word V1.7 (actual release).

Any help is really appreciated


#2

There is no direct way to create an empty document in Aspose.Word yet, however it is easy to work around:
1. Create an empty document in MS Word.
2. Open it in Aspose.Word.
The document is not really "empty" it contains page settings, predefined styles and so on, that's why it's better to create it in MS Word even it is "empty". We will add direct empty document creation to Aspose.Word later.

I'm not sure why you think it's not possible to save the document using a different file name, it is a normal operation, check all available overloads of Document.Save:

Word word = new Word();
Document doc = word.Open("Blank.doc");
doc.Save("NewFileName.doc");