I need to create an empty template for using it later in my application. I am using the following code to create the template:-
using (WordprocessingDocument template = WordprocessingDocument.Create(templatePath,
DocumentFormat.OpenXml.WordprocessingDocumentType.MacroEnabledTemplate, true))
{
template.Close();
}
But, later in the application, when I try to create a document out of this template, I receive the error mentioned next:-
Globals.ThisAddIn.Application.Documents.Add(templatePath));
The error is:
Word was unable to read this document. It may be corrupt.