Bug 52610 - FILESAVE particular document as .docx (Office Open): Can not be opened with other office software
Summary: FILESAVE particular document as .docx (Office Open): Can not be opened with o...
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium major
Assignee: Cédric Bosdonnat
Whiteboard: target:3.7.0 target:3.6.1 target:3.5.7
: 52612 (view as bug list)
Depends on:
Reported: 2012-07-28 03:15 UTC by ape
Modified: 2013-10-07 21:39 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:

Bad DOCX-file by LibO_Writer (50.30 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2012-07-28 03:15 UTC, ape
Good DOCX-file by MSO_2007_with_ODF_Add-in (92.18 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2012-07-28 09:11 UTC, ape

Note You need to log in before you can comment on or make changes to this bug.
Description ape 2012-07-28 03:15:22 UTC
Created attachment 64811 [details]
Bad DOCX-file by LibO_Writer

A. The file "DOC-export footnote Error.odt" (https://bugs.freedesktop.org/attachment.cgi?id=57017) save as a Office Open XML text-document (Microsoft Office 2007/2010) "DOC-export footnote Error. docx" - see attachment.
 B. Open DOCX-file programs: Microsoft Office Word 2007(sp3) or Microsoft Office Word 2003\XP(sp3) with the FileFormatConverters(sp3) or AbiWord or Calligra Words.
 The result:
 - AbiWord crashes;
 - Calligra Words says: "Could not open. Reason: Format not recognized";
 - Microsoft Office Word 2007 says: "Can not open file due to errors of its contents. Details: Unspecified error. Location: Part:/word/document.xml, Line: 2, Column: 2088. (Не удаётся открыть файл из-за ошибок его содержимого. Сведения: Неопознанная ошибка. Местоположение: Часть:/word/document.xml, Строка: 2, Столбец: 2088)".
 This DOCX-file opens the program LibreOffice Writer only and contains many errors, which I will highlight in separate bugs.
Comment 1 Rainer Bielefeld Retired 2012-07-28 06:54:57 UTC
More or less reproducible with parallel installation of Master "LOdev "   - WIN7 Home Premium (64bit) ENGLISH UI [Build ID: 66e4540]" (tinderbox:Win-x86@6, pull time 2012-07-26 02:09:47)	

1. Open reporter's sample
2. Save as .odt
3. close
4. Reopen
5. Save as .cocx (Office Open)
6. close
7. Open with MS WORD Viewer
   Bug: Can't be opened, meaningless Error Message "Error opening Document"

A problem with this (currently) exotic file format is not a blocker.
As long as there is not a realistic chance to get a bug fixed it's not useful to mark it as a MAB. Currently here too much info is missing.

It seems I can also reproduce that problem with 3.3.3, at least the created document can not be opened with MS WORD Viewer.

a) For me the problem also is reproducible when I export a document reduced to page 1 of reporter's sample.

also following steps did not heal the problem:
b) deleting Drawing elements on first page
c) deleting remaining 2 footnotes on page 1
d) deleting a drawing behind TOC
e) Deleting TOC
f) deleting hyplerlinks text from damaged TOC

With some further steps I created a completely empty document, but MS SV was not able to open it.

Currently I see this one as WONTFIX, it is hopeless to try to fix something for a document with such unclear history.

Thank you for your report – unfortunately important information is missing.
May be hints on <http://wiki.documentfoundation.org/BugReport> will help you to find out what information will be useful to reproduce your problem? 
- Write a meaningful Summary describing exactly what the problem is
- Attach a sample odt. source document or refer to an existing 
  sample document in an other Bug with a link. LibO opens a rather damaged 
  document version from the .odx, and damages become worse with any new 
  save - reopen. So we can not do anything without that source document
– if possible contribute an instruction how to create a sample document 
  from the scratch
- add information (if available)
  -- what EXACTLY is unexpected / wrong
  -- and WHY do you believe it's unexpected (Wrong SML code, cite 
     Specification Help or Documentation!)
  -- concerning your OS (Version, Distribution, Language)
   -- concerning your LibO version (with Build ID if it's not a public release)
     and localization (UI language, Locale setting)
  -- everything else crossing your mind after you read linked texts

I am afraid it would be wasted time to submit bugs related to this document, time would be invested better with creating a new .odt from the scratch and checking for .docx export bugs.
Comment 2 ape 2012-07-28 09:11:28 UTC
Created attachment 64816 [details]
Good DOCX-file by MSO_2007_with_ODF_Add-in

Explain the action (LibreOffice Writer for all versions, all operating systems):
 1. Open the file "DOC-export footnote Error.odt" (see attachment_57017, Bug_46020; https://bugs.freedesktop.org/attachment.cgi?id=57017).
 2. File save as a text document "Microsoft Office 2007-2010" - "DOC-export
footnote Error.docx" (see attachment_64811;
 3. Open the file "DOC-export footnote Error.docx" by MSO_Word or AbiWord or Calligra_Words.
The file can not be opened.

I haven't written for a long time about this error, considering that the original file (DOC-export Error.odt) a sordid footnote formatting and styles. I reported an error only when was able to open and save this file in the OO_XML's format is almost the same as it has in the Libre Writer. Microsoft Word 2007 with the extension “ODF_Add-in_For_Office” performed this work. Results (file “DOC-export footnote Error_tmp2.docx”), which will be opened all programs is attached to this message.

@Rainer: see this file first by The WordViewer, then – by The Calligra Words and, finally, by The Libre Writer. It is possible that you will change your opinion.

I've compared the content of both .docx files and found some differences. File “DOC-export footnote Error.docx” (LibO) does not contain files that have The “DOC-export footnote Error_tmp2.docx” (MSO_2007).
Are absent:
DOC-export footnote Error_tmp2:\docProps\custom.xml
DOC-export footnote Error_tmp2:\word\theme..
DOC-export footnote Error_tmp2:\word\theme\theme1.xml
DOC-export footnote Error_tmp2:\word\endnotes.xml
DOC-export footnote Error_tmp2:\word\webSettings.xml
It seems to me that the fault rests in styles.
Comment 3 Rainer Bielefeld Retired 2012-07-28 11:39:50 UTC
Already [Reproducible] with "LibreOffice 3.3.3  German UI/Locale [OOO330m19 (Build:301) tag libreoffice-] on German WIN7 Home Premium (64bit). Neither MSO2007.docx nor OOXML.docx can be opened with MS WORD Viewer, instead error message.

Also reproducible with attachment 57017 [details] reduced to first page and did further tests with master.
a) removed Footnotes: did not heal problem
b) removed TOC, Page Footer:  did not heal problem

Dataloss, so Major

Most elegant way to cite a bug (with link) is simply to type the word "Bug" followed by a space followed by he bug Number. All your underscores and similar only worry automatic Bugzilla functions.
For details please see <https://wiki.documentfoundation.org/QA-FAQ#How_to_use_attached_sample_documents_for_multiple_Bug_Reports>

Please set Status to ASSIGNED and add yourself to "Assigned To" if you accept this Bug or forward the Bug if it's not your turf.
Comment 4 Rainer Bielefeld Retired 2012-07-28 14:20:15 UTC
This one remains a "one document in the world" problem. When I copy / Paste some few contents to a blank new WRITER  document (after I had deleted the footnotes), saved.docx can't be opened with MS WORD Viewer.

But when I copy the contents to a text editor and from there to a bland new Writer document, I find no way to reproduce the problem with new document.
Comment 5 ape 2012-07-28 19:20:35 UTC
It seems to me that the reason found. DOCX-filter is incorrectly structured Table Of Contents («Оглавление»).
If (attachment 57017 [details]):
a) Delete Table Of Contents (with hyper-links) in the ODT file
b) Save changes to the ODT file
c) ODT file save as “.docx”
Then a DOCX-file was opened by WinWord in corrupted text recovery mode.
WinWord has reported:
a) Cannot open the file because of errors in its content. (Undeclared prefix. Part:/word/footnotes.xml, Line: 2, Column: 56233)
 I think this is Bug 46020.
b) When you open a damaged file the following corrections have been made... (A list of footnotes with no. 1 to no. 15)
 I think it is content's hyper-links, which was deleted.
Comment 6 Rainer Bielefeld Retired 2012-07-28 19:28:40 UTC
I think that is in accordance with all observations.
Comment 7 ape 2012-07-29 03:35:59 UTC
@ Rainer:
 I agree with you. But I gave it an error creating footnotes in two different bug (see: Bug 46020, Comment 16 and Bug 52612).
 About "one document in the world"
I think the reason is different. The action "save as Renamed.odt" just overwrites the file name and personal information in order to perform this operation in the shortest time.
 a) Errors in establishing the structure of the old ODT-file (for example, the old file was created dev_LibO-3.x.0alpha), are present in the new ODT-file.
 b) Such errors are very difficult to recreate in the latest versions of LibreOffice.
Such errors would be an archaeological artifact, if the action "save as Renamed.odt" will be:
 a) old file will be checked for compliance with Standard
 b) the structure of the new ODT file will corrected.
Comment 8 Not Assigned 2012-08-02 08:31:00 UTC
Cedric Bosdonnat committed a patch related to this issue.
It has been pushed to "master":


fdo#52610: Fixed several docx export bugs
Comment 9 Cédric Bosdonnat 2012-08-02 08:31:24 UTC
Comment 10 Not Assigned 2012-08-02 08:43:28 UTC
Cedric Bosdonnat committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":


fdo#52610: Fixed several docx export bugs

It will be available in LibreOffice 3.6.1.
Comment 11 ape 2012-08-04 04:37:41 UTC
Cedric, congratulations! The great nice work - bug 52612 is closed, too.
LibreOffice-3.5.6rc2 needs in this patch too.
Comment 12 Rainer Bielefeld Retired 2012-08-05 17:09:50 UTC
Modidied "Assigned To" due to facts.

Of course it would be great to have the fix in 3.f, but we will have to balance the risks.
Comment 13 ape 2012-08-06 10:27:22 UTC
(In reply to comment #12)
> Modidied "Assigned To" due to facts.
> Of course it would be great to have the fix in 3.f, but we will have to balance
> the risks.

It's not good news... I will use "LibO-Dev_3.6.1.0" (last update).
Comment 14 Not Assigned 2012-08-06 14:45:37 UTC
Cedric Bosdonnat committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":


fdo#52610: Fixed several docx export bugs

It will be available in LibreOffice 3.5.7.
Comment 15 ape 2012-08-06 14:52:59 UTC
Good, I found something else (ODF to DOCX then FILE REOPEN..), after fixing the error by Cedric. Is there a need to create a new bug?
Comment 16 ape 2012-08-06 15:28:30 UTC
(In reply to comment #15)
> Good, I found something else (ODF to DOCX then FILE REOPEN..), after fixing the
> error by Cedric. Is there a need to create a new bug?
I think this is a symmetric error reading TOC of DOCX file when LibO Writer opens its.
Comment 17 Jorendc 2013-10-07 21:39:03 UTC
*** Bug 52612 has been marked as a duplicate of this bug. ***