OpenOffice Read Error in sub document content.xml solution

OpenOffice is a must have software in my arsenal.It is free and easy to use.But recently I faced weird problem using this software.I was working on conversion of CSV file to Word file.During this process I was facing a strange problem while opening a file.

OpenOffice failed to open the file.It was throwing below message while opening the file

Read-Error format error discovered in the file in sub-document content.xml at 219,64 (row,column)

Honestly I never faced such problem before.I was wondering whether my conversion program has some issues.But after spending some time I found the conversion program is working fine.The problem was with OpenOffice.So I installed LibreOffice.I tried opening the file in LibreOffice as well.LibreOffice was also throwing the same problem.

After that I mailed the file to my friend with Microsoft Office.The file opened successfully in Microsoft Office.This confirmed my thought that the problem is with OpenOffice only.LibreOffice is based on OpenOffice only.After spending sometime with the file and analyzing the location reported by OpenOffice I was able to solve the problem.

There is not much available on Internet as well about this problem.So I am reproducing all the steps here.Later in the tutorial I will share some observations which might save you lots of time.You can directly modify your file without following below steps.

  • Extract the file using 7 Zip.I prefer 7 Zip.But other extraction programs may also work.It is better to extract the file inside a new folder.So that you are aware of all the files generated by extracting the file.
  • You can see styles.xml,mimetype,meta.xml and content.xml files inside the extracted folder.Apart from these files there is also META-INF folder.
  • Now open the content.xml file with any text editor.I would recommend using Notepad++.Notepad++ is an excellent multi purpose text editor software.I have written separate post on its search and replace capabilities.It can search and replace text in multiple files within a directory.In case you are interested then you can read the post here.
  • The problem with Notepad and Wordpad are that they do not show line numbers.So it is tough to find out the problem reason.Notepad++ gives you line numbers.The error message have row and column.The row corresponds to line number.So Notepad++ makes it easier to locate the line in which you have problem.
  • Now go to the column to see the character creating the problem.You need to delete the character from your OpenOffice document or use different character in its place.
  • You can make above modification and save the file.After saving the file you should try opening it again.
  • It should work fine.But if not then it will be facing issue in some other row and column.
  • You should do same procedure as above for problematic row and column.
READ  Incomplete microdata with review tag solution

I faced this problem many a times while working on above project.The characters causing the problem were & (ampersand) and < (less than symbol). So if you are facing Read Error in sub document at content.xml you can skip above procedure and do as mentioned below. First evaluate impact on your document if you replace & and < with their meaning.If there is no huge impact on your document then you can replace these special characters with their appropriate meaning in the document.After making the changes you can open your document to see if it is working fine. I have not faced problem due to other characters.These were the only two characters.I do not know the reason why these characters were creating the problem.This is may be task of excellent OpenOffice persons.They can make appropriate changes to handle this scenario as well.

One comment OpenOffice Read Error in sub document content.xml solution

  1. LibreOffice exports all settings
    All the settings of LibreOffice, all in the LibreOffice folder.

    C:\Users\a←When installing the operating system, the name entered.\AppData←File Manager ~ “Hidden project” to open, the AppData folder will be displayed.\Roaming\LibreOffice

    Back up the LibreOffice folder, when reinstalling, put the LibreOffice folder in its original place.

    1. If the installation is preview edition, because the name of preview edition is LibreOfficeDev, so the LibreOfficeDev folder will be displayed.
    2. Formal edition can be installed together with preview edition, if both formal edition and preview edition are installed, LibreOffice folder and LibreOfficeDev folder will be displayed.
    3. To clear all settings, just delete the LibreOffice folder, then open the program, a new LibreOffice folder will be created.

    LibreOffice exports a single toolbar I made
    Common path
    C:\Users\a←When installing the operating system, the name entered.\AppData←File Manager ~ “Hidden project” to open, the AppData folder will be displayed.\Roaming\LibreOffice\4\user\config\soffice.cfg\modules\Please connect the branch path of the individual software below.

    Branch path
    \modules\StartModule\toolbar\The “Start” toolbar I made is placed here.

    \modules\swriter\toolbar\The “writer” toolbar I made is placed here.

    \modules\scalc\toolbar\The “calc” toolbar I made is placed here.

    \modules\simpress\toolbar\The “impress” toolbar I made is placed here.

    \modules\sdraw\toolbar\The “draw” toolbar I made is placed here.

    \modules\smath\toolbar\The “math” toolbar I made is placed here.

    \modules\dbapp\toolbar\The “base” toolbar I made is placed here.

    Backup file, when reinstalling, put the file in the original place.

    1. Because of the toolbar that I made myself, default file name, will automatically use Numbering, so to open the file, can know the name of the toolbar.
    2. The front file name “custom_toolbar_” cannot be changed, change will cause error, behind’s file name can be changed.
    For example: custom_toolbar_c01611ed.xml→custom_toolbar_AAA.xml.
    3. Do well of toolbar, can be copied to other places to use.
    For example: In the “writer” Do well of toolbar, can be copied to “calc” places to use.

    LibreOffice self-made symbol toolbar
    Step 1 Start “Recording Macros function”
    Tools\Options\Advanced\Enable macro recording(Tick), in the “Tools\Macros”, the “Record Macro” option will appear.

    Step 2 Recording Macros
    Tools\Macros\Record Macro→Recording action (click “Ω” to enter symbol→select symbol→Insert)→Stop Recording→The name Macros stored in “Module1” is Main→Modify Main name→Save.

    Step 3 Add item new toolbar
    Tools\Customize\Toolbar→Add→Enter a name (example: symbol)→OK, the new toolbar will appear in the top left.

    Step 4 Will Macros Add item new toolbar
    Tools\Customize\Toolbar\Category\Macros\My Macros\Standard\Module1\Main→Click “Main”→Add item→Modify→Rename (can be named with symbol)→OK→OK.

Leave a Reply

Your email address will not be published. Required fields are marked *