WhiteSpace in Merge Fields


#1

Is it possible to do the following with merge fields in the doc…

a) Insert a page break

b) Insert a new line

In a string, a vbCr makes a new line, but inside a table it puts a ‘square’ character…





#2

To insert a page break you need to insert character #12, try this:
public const char PageBreak = (char)12;
Page break should work well because it is just a simple character.

You can also insert character #11 which is a line break, it will be handled correctly.

It is more sophisticated with paragraph breaks. Strictly speaking there could be some problems because Aspose.Word does not create paragraphs for paragraph breaks inserted in this way, but Word seems to work well regardless. Maybe the square character you get in a table is just that.

We had customers in the past who inserted text with paragraph breaks into merge fields successfully, I also have it working in a test.

To insert a paragraph break you need to use character #13:
public const char ParaBreak = (char)13;