We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Don't replace a mergeFields

Hello, could you help me with aspose.words. I created that and not working, I don’t know why :confused:


When I use that where is comment it’s OK. But if I use taTable I have problem :confused:
I attached a word file.
When I check rs I have all information what I want. I debug that. Why aspose don’t replace a mergefields ?
I have aspose words 14.8.0.

Document document = new Document(templateFile.getAbsolutePath());
ResultSet rs = executeQuery(null, mobject.getTableName(), instanceId);

DataTable table = new DataTable(rs, “test”);
DataSet dataSet = new DataSet();
dataSet.getTables().add(table);
document.getMailMerge().executeWithRegions(dataSet);


// document.getMailMerge().execute(
// new String[]{“imie”, “nazwisko”},
// new Object[]{“dupa”, “jasio”}
// );
document.save(resultFile.getAbsolutePath(), switchFormatFile(docType));

saveFileId = fileService.saveFile(resultFile, null, null, null, objectId, instanceId);

Any help I try that :

«TableStart:test»<o:p></o:p>

«imie» «nazwisko»

«TableEnd:test»

please closed, I repair

Hi Mireczek,


It’s great you were able to find what you were looking for. Please let us know any time you have any further queries.

Best regards,