Hello, I am generating a mail merge template and a data source (CSV) file with Aspose.Words version 14.12. I want to allow my client to edit the template within Word. When I open the template with Word 2013, I receive an error from Word: APC_A.docx is a mail merge main document. Word cannot find its data source, c:\users\jschmid\Desktop\APC_A.csv.
Needless to say, the file does exist. I can use Word to remove the data source, then manually link to the data source file and it works as expected.
When creating the template, I’m using the following code to specify the data source:
mySrcDoc.MailMergeSettings.DataSource = "c:\users\jschmid\Desktop\APC_A.csv"
mySrcDoc.MailMergeSettings.MainDocumentType=Settings.MailMergeMainDocumentType.FormLetters
mySrcDoc.MailMergeSettings.DataType = Settings.MailMergeDataType.TextFile
mySrcDoc.MailMergeSettings.Query = "SELECT * FROM c:\users\jschmid\Desktop\APC_A.csv"
I’m sure its something silly that I have not set properly, but I cannot find it. I even manually linked a data source in Word and opened that with Aspose.Words, but the settings look identical to what I used. I’ve attached the document and test data file I created.
Thanks,