#1
|
|||
|
|||
Cross reference a table caption below a repeated mapped content control
Hi!
I have a word template with multiple tables with table captions. The table content consists of xml-mapped content controls as plain text, where each row is a repeated section. Under each table there is a table caption. The CustomXMLPart is updated by programmatically replace/update the xmlfile within the file structure. When adding more rows to a table in the xml-file and opening the template it all looks fine. The table is expanded with the new information. Lets say I have i cross reference to "Table 1" another place in the document. When I hit Ctrl+a and F9 to update fields and cross references, the new rows added to the table disappears from the table, but gets added to the cross reference text instead. After some investigation using vba, it seems that the Bookmark.Start value remains unchanged, and only the Bookmark.End value is reflecting the newly added content/document size. Am I doing it all wrong? before.PNG is how it looks before hitting F9, after.PNG is as you probably guessed after updating. What can i do to keep it as shown in before.png? |
#2
|
||||
|
||||
That is unfortunate. It is particularly problematic because if you update the cross-ref a second time the added rows disappear completely.
I don't pretend to know why this might happen but the behaviour of inserting content at the same point as the start of a bookmark is the cause. A couple of workaround suggestions to avoid this issue are: 1. Put your table captions above the table. IMO, table captions below tables doesn't work well with how people use a caption. If the table breaks across a page, having the caption appear after the first page of the table is not very user friendly. 2. Include an empty paragraph between the table and the caption. If you add this empty paragraph in front of the caption, make sure the cross-ref doesn't include it when it updates. You can also make this empty paragraph hidden (in the font dialog) to hide the fact that it is there.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
Tags |
captions, customxmlpart, table |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Insert a cross-reference in a caption | RomFigo | Word | 9 | 09-25-2015 12:32 AM |
Cross reference content control list with autotext or other text | markmichel64 | Word VBA | 5 | 01-30-2015 01:41 AM |
Caption-Cross-reference-TOF Problems | sleake | Word | 10 | 12-18-2013 12:56 PM |
Cross Reference to Content Control | brent.fraser | Word VBA | 10 | 12-14-2012 12:43 PM |
How to control the caption and their Cross-reference? | Jamal NUMAN | Word | 1 | 04-10-2011 03:23 PM |