Error 'Failed to Create the Part's control'

Hello everyone,

I just experienced a strange behavior with M2Doc (v3, on Capella 1.4.0).

After a template generation, it was impossible to open it from eclipse (see picture),

The file opens when you use Word though.
So I have done a little bit of searching, and identified what part of my template was responsible.

I found that to delete this piece of code remove the problem:

So I tried to create a new template with only this piece of code in order to make a little more investigations… However, the generation worked fine for this new template !

Any idea of what can be this behavior ?

Rgds

You have this error when opening the word document inside Eclipse ? It’s probably related to the integration of MS Word with Eclipse… not sure how to improve that.
Some time this can happen when the document is already opened in MS Word outside Eclipse or by some other process. I don’t think this is related to the document itself.

Yes, it was while opening the document in Capella.
If I then try to use Word, the following error appears:

image

And then

.

By clicking yes, my document is generated. So it is not prevent me to do anything, even if there is that strage error.

Hi,

Something in the footer is generating an invalid document. Default header and footers presentations from MS Word are known to produce his kind of error with M2Doc.

Thank you very much Yvan !

I’m seeing the same issue, however isolating the queries in an otherwise pristine Word document (without headers and footers) does not fix it. I’m also attempting to output representation images in a for loop.

When opening the generated document outside of Capella, Word complains with the following message:

“we found a problem with it’s contents. Details: HRESULT 0x80004005 Location: Part: /word/header2.xml, Line: 0, Column: 0”

Word then offers to “recover the contents” of the document, which works.
It is Microsoft Office Professional Plus 2019. On the other hand, LibreOffice can open the generated document without issues.

I extracted header2.xml from the .docx to investigate, but it seems to be valid XML.

Can you compare it with the one in the template ? That might give a better idea about what is breaking the XML…