Having trouble licensing Aspose.Word

I have currently upgraded Aspose.Word to the current 3.3 version and used your sample code for registering the license

Dim license as License = New License

license.SetLicense("Aspose.Word.lic")

which is used before I run any merging. The problem is that I am still seeing the red sentence at the top of all the merges that tells me that I am using an evaluation version.

I have tried setting the license to an Embedded Resource, tried specifying the exact path, and which was deemed the easiest putting the license in the same directory as the DLL so I wouldn't have to worry about path. So far nothing seems to work.

Please HELP!!! Any suggestions would be greatly appreciated.

Regards,

Mike

If the instruction

license.SetLicense("Aspose.Word.lic")

fails to find any license, it ends up in exception:

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in aspose.word.dll

Additional information: Cannot find license 'Aspose.Word.lic'.

So, if you instruction gets executed and you don't have an exception, you don't need to worry that your license was not found.

Try setting a breakpoints on SetLicense instruction and on the code that actually opens your document, e.g.

Dim doc as Document = New Document("Doc1.doc")

And make sure that the first occurs before the latter.

I have already looked at the code with breakpoints to make sure the license was being set before the document. Here is a bit of the code:

Dim license As License = New License

license.SetLicense("Aspose.Word.lic")

dtFinal = Session("dtMaster")

drPreview = dtFinal.Rows(CInt(e.Node.Value))

Dim doc As Document = New Document(System.IO.Path.Combine(Server.MapPath("TemplateUpload"), e.Node.Text))

doc.MailMerge.Execute(drPreview)

doc.Save("Preview.doc", SaveFormat.FormatDocument, SaveType.OpenInWord, Me.Response)

As always..any insight into getting this working is appreciated.

Regards,

Mike

Make sure the document you are opening has no evaluation watermark in it. Aspose.Word licensed version does not remove old watermarks. It just stops injecting new watermarks.

If nothing helps, step down to the simplest: open and save a file on a local disk from an explicit path. I mean remove MapPath, save to the browser. Double check paths etc.