-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open Word docx file with "The image part with relationship rID8 was not found" error, it always fails #1105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
error traces like below:
|
@paradise321 You can override load_from_xml of python-docx to skip the element which target_ref is null. Put this code before "doc = Document('.\WordHasSomeProblem.docx')".
|
This is a GENIUS fix! |
It did solve my problem |
Cool! |
Hello, I am having a similar problem, but the error is this:
Please, could you advise me how to change the suggested solution code to fix my issue? Thanks! |
I modified the line: and now it works! |
When I try to open a docx file with "The image part with relationship rID8 was not found" error, the following error is reported always.
The code is as simple as following:
WordHasSomeProblem.docx
The problematic word file is attached, i.e., WordHasSomeProblem.docx
As Microsoft has declared here: https://docs.microsoft.com/en-us/office/troubleshoot/word/image-part-relationship-rld8-not-found-error-microsoft-word, the problem happens here is because of some target field was set to "NULL.".
My question is: is that possible to add some parameter in Document() to just ignore this kind of errors and continue loading the docx into RAM?
Thanks!
The text was updated successfully, but these errors were encountered: