Hi guys,
I'm using content controls since they were introduced in Office 2007 and found them very helpful when it comes to automatic document creation, especially with custom XML data and appropriate data bindings. I handled repeating sections myself through custom
code and it worked fine, though it was quite complex in the beginning. It's now the first time that I'm playing with the repeating content control in Word 2013 and it works perfectly regarding the data. However, the formatting is driving me nuts.
I have a table with two rows and six columns. The first row contains the headers (just text) and the second the data, using six content controls, one per column and all of them being plain text controls. The text in colums 1, 4, 5 and 6 aligns to the right.
The font style in column 1 is italic and in column 2 its bold.
I'm using a repeating content control around the entire second row and bound it to an XML element in a custom XML part. This element can occur multiple times and thus the table may have multiple data rows. The custom XML part is replaced with real business
data through a .NET application. Everything works fine except for the formatting. The first colum is properly aligned to the right and uses the italic font style. The second column, however, only displays the first data row in bold. Subsequent rows are usingt
a regular font style. And columns 4, 5 and 6 are aligned to the left, instead to the right.
The same happens when adding a new row to the data bound table in Word itself. After the repeating content control is bound to a repeating XML element, we can click on the plus sign right to the last column to insert a new row, which also adds a new element
to the XML stored in the custom XML part. The newly inserted row shows the same behavior (wrong alignment, wrong font style). It makes no difference if I'm using plain text controls or rich text controls. I even marked the entire document and set the text
alignment to right, but the text alignment is always wrong as described before. The styles are persisted if the repeating content control does not repeat a table row, but that doesn't help.
Before trying to fix it programmatically I wanted to know if someone knows a solution or workaround.
Thanks in advance,
Michael