Hi,
Using Aspose.Words v11.3 under .NET, is it possible to attach a data source to a document without executing the mailmerge itself?
Although the majority of our users will want the resultant document straight away (which I can provide by using “
doc.MailMerge.Execute(datasource)”), there a some users who need the document to be sent to them in an unmerged state with the data source embedded. This allows them to modify the document appropriately and then run the mailmerge.
To add more information: at present, the datasource that is being used with the execute command is a simple DataTable. I can’t any way to attach this DataTable to the document without merging. What I can see is “
doc.MailMergeSettings.DataSource” property but this appears to be wanting a file path, which is not appropriate in this situation… as I really don’t want to have to save the data into a local file first.
Edit:
I’m starting to think this through more, and I’m coming to the conclusion that my question might be fundamentally flawed - and that it’s not actually possible to attach/embed a datasource within a document.
The reason I’m asking for this functionality is because I’m convering our ASP.NET application away from using client-side Word automation, which is currently working via an old VB6 ActiveX component. The OCX was written in such a way that the “template document” was loaded by Word, and then it created a data source document and attached it - and then the mail merge was run if required, otherwise it was left in the state of the original document with attached data source.
Office 2013 is screwing us up, because it puts documents automatically into “View Mode”, and to work properly requires a property to be set to put it into “Edit Mode”. However, the idea of updating, distributing and install a new ocx/dll is a horrifying one, and that is why I’m trying to use Aspose instead.
Can anybody confirm that I’m effectively asking for Aspose to do something that can’t be done??
Many thanks,
Tom