Free Support Forum - aspose.com

Mail merge for documents contained in a folder or local documents

I’m trying the following with C# SDK

folder.UploadFile(@"" + DocFilePath, “FOLDER”);

mailmerge.ExecuteMailMerege(“FOLDER/” + inputFileName, doc.InnerXml, SaveFormat.Pdf, OutputPath);

It gives me 404 not found. Seems like ExecuteMailMerge does not support documents located in folders? Maybe I can do mail merge with local file as an input?


Submitted from: http://saaspose.com/blog/

Hi Denis,

Yes, you are right; this method was not handling folders/sub-folders. Now all methods of MailMerge.cs class have been updated to handle folders/sub-folders. Please download latest .NET SDK or MailMerge.cs class from https://github.com/saaspose/Saaspose.SDK-for-.NET/blob/master/Saaspose.SDK/Words/MailMerge.cs

You can also try the updated MailMerge examples from http://saaspose.com/docs/display/words/1.3.1.4+-+Working+with+Mail+Merge

Please let us know if you still find and issue or have further queries.

Best Regards,
Muhammad Ijaz
Support Developer, Saaspose Sialkot Team
http://www.saaspose.com

Hi Muhammad,

Thanks a lot for a quick solution. I got an impression that sometimes when you creating folder right after that uploading file in there and executing mail merge server side hangs on mail merge template execution. Once you re-run the program when the folder was pre-existing it's not the case. Maybe I'm wrong.

Attaching my C# script.

Best
Denis

Hi Denis,

I have also observed similar behavior in some cases when using .NET SDK. There is no issue with the service or other SDKs, this is .NET specific issue. Streams and responses are not closed properly in some methods of .NET SDK which creates this problem.

We are updating .NET SDK to resolve this bug and let you know once it is done. Sorry for the inconvenience.

Best Regards,
Muhammad Ijaz
Support Developer, Saaspose Sialkot Team
http://www.saaspose.com

Hi Denis,

This issue is resolved now; please download the latest version of .NET SDK from https://github.com/saaspose/Saaspose.SDK-for-.NET and feel free to contact us in case you have further comments or questions.

Best Regards,
Muhammad Ijaz
Support Developer, Saaspose Sialkot Team
http://www.saaspose.com