Word captions removed by M2Doc

Hi all,

I have the problem that any captions I create in my template are removed by M2Doc and converted into static text, e.g. Figure { SEQ Figure \* ARABIC}: Title is converted to Figure 1: Title in every case of my document and therefore, the table of figures is empty in the generated document, while it shows all links correctly in the template.

After some research in the forum I saw that this is indeed an M2Doc problem (https://forum.mbse-capella.org/t/postprocessing-of-m2doc-documents-by-visual-basic/449). However, it is not yet clear to me if this bug is fixed, in what version this bug is fixed and if this version is compatible with the Capella version I’m using (kind of fixed on the Capella, unfortunately). I’m using Capella 1.4.2 and M2Doc 3.1.1.

Thanks and best regards,
Jamo

This bug is not fixed yet:

You can have a list of all opened bugs here.
You can update your version of M2Doc to the last version 3.2.0 by using the following update site:
https://s3-eu-west-1.amazonaws.com/obeo-networkaggregation-releases/capella-extensions/1.4.1_M2Doc3.2.0/full
If you need the zipped version or an other version of the M2doc Capella extensions you can have a look at this page.
Updating M2Doc will not fixe this issue, but it will given you access to the new M2Doc interpreter view which can be handy to write AQL expressions and see the result in the context of your .genconf file.

1 Like

Hi Yvan I have an update from my side. Apparently the bug does NOT appear when using Office 2010 instead of Office 2016. A colleague and I found this out by chance (both with capella 1.4.2 and M2Doc 3.2.0). Maybe something essentially changed between versions in how Word processes fields which M2Doc does not recognize correctly anymore.

Thank you for this input. Can you provide a document with a figure reference made with MS Word 2010 and another one made with MS Word 2016 ?
You can attach them to the following issue:


That will help me to figure out how to fix this bug.

Uploaded example templates and their resulting generated documents

Another note: When editing the 2010 file with Word 2016 the export does NOT work correctly anymore. However, if I edit the file afterwards again with Word2010 it’s fine. So I assume there is some metadata between 2010 and 2016, because I only did "fake"changes. E.g. adding a word, saving, deleting the word again, saving. So the content is the same, but something is different depending on which word you use to save the file.

Thank you for your help. That something I’ll have to check, also M2Doc rely on Apache POI to read/write the MS Word document. So some limitations might come from POI.

Hi,
I have made the same experience in case the value for ‘UpdateFields’ is ‘true’.
In case the value for ‘UpdateFields’ is ‘false’ the captions still exist and are visible as fields but the document internal ID has changed.
This leads to that all references pointing to this caption showing an empty result after being updated (and the old content before being updated).
To me it looks like as if the captions are rewritten during each M2Doc document generation. It is just the result that is different either empty captions (‘UpdateFields’ is ‘true’) or captions with new identifiers (‘UpdateFields’ is ‘false’).
What I have observed:

  • create a caption and a reference to this caption
  • generate a document based on this template ( ‘UpdateFields’: ‘false’)
  • compare the IDs in the reference to the caption (they are the same)
  • update the reference to the caption manually (F9)
  • reference seems to disappear (for me it is still there but has ‘empty’ content, the field function for the reference is still there and can be modified)
    May be this can help in finding the cause of the problem.

At least for me most referencing within the template (captions, sometimes heading titles) are affected by this one way or the other. The only way I have currently to circumvent this is to generate a document that does not contain captions and references and manually merge this into a final document that contains matching captions and references.

1 Like

Thank you for your input, It will definitely help me corner this bug.