I am running 10.1.0 runtime version v2.0.50727.
I executed the following:
string reportDir = HttpContext.Current.Server.MapPath("Reports/");
string filePath = Path.Combine(reportDir, template);
if (!File.Exists(filePath))
return string.Format("Report {0} template does not exist on server", template);
if (reporttype == "I")
PopulateIncident();
else
PopulateEvent();
PopulateMisc();
Document doc = new Document(filePath);
// Header Merge Fields
String[] fieldNames = new String[]
{"CurrentDate","CurrTime","DoctorName","StartDate","EndDate","StartDay","EndDay","CenterName"};
Object[] fieldValues = new Object[]
// {CurrentDate,CurrTime,DoctorName,StartDate,EndDate,StartDay,EndDay,CenterName};
{ DateTime.Now, DateTime.Now, "Keith", DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, "Keith" };
doc.MailMerge.Execute(fieldNames, fieldValues);
return "doc.MailMerge.Execute sucessful";
I received the identical object reference error. I am running this solution on a hosted Network Solutions site, thus I have to use the remote filePath. The trace does indicate it is within an APOSE assembly. The return statement following the doc.MailMerge.Execute(...) call is never executed. In a prior execution I included a return prior to the doc.MailMergeExecute() call, it executed normally and returned me to the application.
I rechecked the Aspose.Words.dll assembly loaded on the Website, it is the 10.1.0 version (Downloaded 6/13/2011).
Any other suggestions on where I should look?