Free Support Forum - aspose.com

Special Character to new line

Is there a possibility on

getMailMerge().execute(String, String) to set a special Charakter in a String paramter for force Word to make a new line.

As “\par \pard” in RTF

thank

Hi Michael,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. You can just use \n. Please see the following code:

Document doc = new Document("C:\\Temp\\in.doc");

doc.getMailMerge().execute(new String[] { "myField" }, new Object[] { "This is the first line\nThis is the second one." });

doc.save("C:\\Temp\\out.doc");

Best regards.