Page 1 of 1

[Solved] Load corrupted Writer document without confirmation

Posted: Thu Jul 25, 2024 10:39 pm
by _savage
Hi, when I load a document in Writer I get this message:
oo.jpg
oo.jpg (54.32 KiB) Viewed 2898 times
I can click “Yes” and proceed loading, although some text of the loaded document is somewhat scrambled. Word loads the document equally scrambled but without complaints.

I’d like to proceed programmatically when I call loadComponentFromURL, but can’t find the option. I tried RepairPackage but that didn’t work, and loadComponentFromURL() raises an exception.

How would I go about this?

Thank you!
Jens

 Edit: Changed subject, was [Solved] How to proceed loading a suspected corrupted Writer document? 
Make your post understandable by others 
-- MrProgrammer, forum moderator 

Re: How to proceed loading a suspected corrupted Writer document?

Posted: Fri Jul 26, 2024 1:43 am
by FJCC
It seems you are trying to load a damaged .docx file with LibreOffice. Is that correct? What is your overall goal? Do you only need to load this file or are you writing code for a general application?

Re: How to proceed loading a suspected corrupted Writer document?

Posted: Fri Jul 26, 2024 2:04 am
by _savage
FJCC wrote: Fri Jul 26, 2024 1:43 am It seems you are trying to load a damaged .docx file with LibreOffice. Is that correct?
Well, “damaged” can be argued about because Word loads the file ok. And after clicking “Yes” to proceed the file loads.
FJCC wrote: Fri Jul 26, 2024 1:43 am What is your overall goal? Do you only need to load this file or are you writing code for a general application?
This is in the context of code running a headless Writer instance, so I’d like this to proceed loading the file — just as if I had clicked “Yes”.

Re: How to proceed loading a suspected corrupted Writer document?

Posted: Fri Jul 26, 2024 7:43 am
by Hagar Delest
See if that helps: query about SAXexception, especially this one maybe: [Solved] Avoid SAXException dialog with OLE pywin32.

Please add [Solved] at the beginning of the title in your first post (top of the topic) with the 🖉 button if your issue has been fixed.

Re: How to proceed loading a suspected corrupted Writer document?

Posted: Fri Jul 26, 2024 9:22 am
by _savage
That’s an interesting link, thank you! But turns out that the issue happens on LO 7.5 but not on 24.2 so I upgraded the relevant Docker images 8-)