To evaluate whether or not Aspose will fit our needs, I am trying out some proofs of concept. I am trying to follow the example at http://www.aspose.com/docs/display/wordsnet/Hello+World+Example
I have a blank Word document with the following in it;
<> says: “<>.”
I then have the following code in a .NET 4 windows form app;
private void ExportReport(string exportPath, string fileName)
{
Document doc;
if (!Directory.Exists(exportPath))
{
Directory.CreateDirectory(exportPath);
}
string wordTemplateFilePath = Path.Combine(exportPath, "test.docx");
doc = new Document(wordTemplateFilePath);
// Replace content
Sender s = new Sender("LINQ Reporting Engine", "Hello World");
ReportingEngine engine = new ReportingEngine();
engine.BuildReport(doc, s);
doc.Save(Path.Combine(exportPath, fileName));
}
public class Sender
{
public Sender(string name, string message)
{
Name = name;
Message = message;
}
string Name;
string Message;
}
But it doesn't work. No Word document is ever generated. If I step through the code, it reaches the line ReportingEngine engine = new ReportingEngine();
engine.BuildReport(doc, s); but then quits the debug after I step over this line. No errors are generated.
Am I missing something? I have downloaded the latest trial version of Aspose.Words via nuget in VS 2012.