0
votes

We have a word document with Rich Text Content Controls. Some of the Content Controls contain Tables. If a caption is added to these Tables, it places the caption in the Content Control proceeding the selected or current Content Control. It seems that for a Table placed without line/paragraph breaks, the Content Control Tags start and end in the first and last cells. Please see the image for an illustration: enter image description here

Ex: What is should be

<tag>Content</tag>

For Tables:

<firstcell><tag>Reset of the Content</tag></lastcell>

I am unable to insert a line break manually (Ctrl + Shift + Enter) or using VBA. How can I add a line break before the table inside the content control. Or How can I make sure that the caption is put on top and inside the Content Control (VBA). Thank you.

1

1 Answers

1
votes

Content Controls can in context of tables wrap only the following: - Whole table - Whole table Row - A table cell

In your case (your screenshot) the CC does not start in the first and ends in the last cell but is rather wrapping the whole table. MS Word is just showing it like this. It is impossible to do something like this.

If you use Visual Studio, there is an Open XML add-in for VS 2010 you can use to inspect the structure of the document. If you don't you can use a ZIP extractor (remember a docx is just a zip file) and exemine the "document.xml" part in it.