View Single Post
 
Old 10-22-2021, 05:38 AM
z|co z|co is offline Windows 10 Office 2019
Novice
 
Join Date: Oct 2021
Posts: 1
z|co is on a distinguished road
Default 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?
Attached Images
File Type: png before.PNG (13.8 KB, 10 views)
File Type: png after.PNG (14.1 KB, 10 views)
Attached Files
File Type: docx tabelltest.docx (26.3 KB, 5 views)
Reply With Quote