I want to make custom links to tables that I create in Word for certain model elements. Since the automatic Word caption generation does not work with M2Doc, I wanted to use a workaround by using Bookmarks and BookmarkRefs to create my own captions.
However, I’m facing the problem that I either have to use fully custom references or pure capella values, I cannot use a mix. Below are two examples that work
Custom reference example:
{m:'start'.asBookmark('start')}
Link to the {m:'beginning'.asBookmarkRef('start')}
Capella value example (with LF being a logicalFunction element):
{m:(LF.name).asBookmark(LF.id)}
Link to {m:(LF.name).asBookmarkRef(LF.id)}
What does NOT work is the following:
{m:(LF.name).asBookmark( (LF.id+'_ref') )}
Link to {m:(LF.name).asBookmarkRef( (LF.id+'_ref') )}
If I do this, a link will be created but it just sends me to the beginning of the document. I checked the created reference IDs and they look how they should look.
What makes it extra confusing is, that when I use the Word cross-reference function I can create working links to the bookmarks that look identical but behave differently (see picture below).