Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-22-2021, 05:38 AM
z|co z|co is offline Cross reference a table caption below a repeated mapped content control Windows 10 Cross reference a table caption below a repeated mapped content control Office 2019
Novice
Cross reference a table caption below a repeated mapped content control
 
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
  #2  
Old 10-23-2021, 02:38 AM
Guessed's Avatar
Guessed Guessed is offline Cross reference a table caption below a repeated mapped content control Windows 10 Cross reference a table caption below a repeated mapped content control Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote
Reply

Tags
captions, customxmlpart, table

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross reference a table caption below a repeated mapped content control Insert a cross-reference in a caption RomFigo Word 9 09-25-2015 12:32 AM
Cross reference a table caption below a repeated mapped content control Cross reference content control list with autotext or other text markmichel64 Word VBA 5 01-30-2015 01:41 AM
Cross reference a table caption below a repeated mapped content control 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
Cross reference a table caption below a repeated mapped content control How to control the caption and their Cross-reference? Jamal NUMAN Word 1 04-10-2011 03:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:29 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft