Hi,
I downloaded and installed latest version and hotfix for aspose.word
I uninstalled previous version via add/remove programs and then ran the msi installer.
Then I replaced the dll in all the .net project directories with the hotfix dll and xml.
Now I get following message:
* Error Message: Problem with License for Aspose.Word Component. Framework Message:The data at the root level is invalid. Line 1, position 1.
As you are generating this error message, you should be able to point out what is going wrong.
I found I also had to rewrite the code I used, because it gave warnings that the calls I was using were obsolete. Here the new version of my code:
===================================================================
public string CreateDocumentCS(string strJobID, string strCaseID,string strTemplateName, string strActivityID, CSCaseData theMergeData) //CSCaseData
{
currentTemplateName = strTemplateName; //pass value to class private var
userNameForSignature = theMergeData.CSCaseDataElement[0].OWNERLOGINNAME;
License license = new License();
try
{
license.SetLicense(ConfigurationSettings.AppSettings["Aspose.Word.LicenseFile"]);
}
catch (Exception e)
{
throw new JobDataException("Problem with License for Aspose.Word Component. Framework Message:" + e.Message);
}
Document mDoc;
string savedTemplateName;
try
{
log.Write("Open template",3,1);
mDoc = new Document(ConfigurationSettings.AppSettings["WordTemplatesDirectory"]+ @"\" + strTemplateName);
}
catch (Exception e)
{
log.Write("Problem with opening template: "+strTemplateName +" CaseID:" + strCaseID,3,1);
throw new CAC.CWFA.CWFAExceptions.JobDataException("Problem with opening template, template name:" + strTemplateName + " Framework message:" + e.Message);
}
//add event handler for inserting signature
mDoc.MailMerge.MergeImageField +=new MergeImageFieldEventHandler(MailMerge_MergeImageField);
//add event handler for bookmark mandatory checks
mDoc.MailMerge.MergeField +=new MergeFieldEventHandler(MailMerge_MergeField);
try
{
mDoc.MailMerge.Execute(theMergeData.CSCaseDataElement);
Console.WriteLine("LETTERER: Setting OWNER TO: " + userNameForSignature);
}
catch(Exception e)
{
log.Write("Problem with merging template: "+strTemplateName +" CaseID:" + strCaseID,3,1);
throw new CAC.CWFA.CWFAExceptions.JobDataException("Problem with template merge, template name:" + strTemplateName + " Framework message:" + e.Message);
}
try
{
savedTemplateName = strJobID + "_" + strCaseID + "_" + strActivityID + "_jca_cwfa.doc";
mDoc.Save(ConfigurationSettings.AppSettings["TemporaryDirectory"]+ @"\" + savedTemplateName);
}
catch(Exception e)
{
log.Write("Problem with saving merged template: "+strTemplateName +" CaseID:" + strCaseID,3,1);
throw new CAC.CWFA.CWFAExceptions.JobDataException("Problem with saving merged template merge, template name:" + strTemplateName + " Framework message:" + e.Message);
}
mDoc = null;
return savedTemplateName;
}
============================================================================
Please help,
Thanks,
Guus.