是否有任何docx修复工具会给出有意义的错误消息? [英] Are there any docx repair tools that give a meaningful error message?

查看:39
本文介绍了是否有任何docx修复工具会给出有意义的错误消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力寻找导致docx文件损坏的原因.

I am struggling to find the cause of a corrupt docx file.

似乎那里有百万个工具可以修复损坏的文件-我已经尝试了5个工具,它们修复得都很好,但是没有一个能提供任何错误源的指示.

It seems that there are millions tools out there for repairing corrupted files - I've tried 5 that all repaired beautifully, but none of them gave any indication of the error origin.

有人知道吗?

开源将是一个奖励.

谢谢.

更新:

我尝试按照frankpl的建议使用Open XML SDK 2.0生产率工具.它看起来很有希望,但它拒绝独立打开我的损坏文件或与其他文件进行比较.

I tried using the Open XML SDK 2.0 Productivity Tool as recommended by frankpl. It looked promising, but it refused to open my corrupt file either standalone or to compare with another.

我发现该文件的[Content_Types] .xml部分之间存在差异,但在更近的地方,只是顺序有所不同-我想这不会考虑到损坏吗?

I found a difference between the [Content_Types].xml part of the file, but on closer It's just the order that's different - I presume this wouldn't account for corruption?

在有效的(由Word修复)文件中:

In the valid (repaired by Word) file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
    <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
    <Default Extension="xml" ContentType="application/xml"/>
    <Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>
    <Override PartName="/word/numbering.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"/>
    <Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/>
    <Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
    <Override PartName="/word/stylesWithEffects.xml" ContentType="application/vnd.ms-word.stylesWithEffects+xml"/>
    <Override PartName="/word/settings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"/>
    <Override PartName="/word/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>
    <Override PartName="/word/fontTable.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"/>
    <Override PartName="/word/webSettings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml"/>
    <Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
</Types>

在损坏的文件中:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
    <Default Extension="xml" ContentType="application/xml"/>
    <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
    <Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>
    <Override PartName="/word/numbering.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"/>
    <Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/>
    <Override PartName="/word/stylesWithEffects.xml" ContentType="application/vnd.ms-word.stylesWithEffects+xml"/>
    <Override PartName="/word/settings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"/>
    <Override PartName="/word/webSettings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml"/>
    <Override PartName="/word/fontTable.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"/>
    <Override PartName="/word/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>
    <Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
    <Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
</Types>

推荐答案

已经晚了很多年,但是您可以使用 DocumentFormat.OpenXml.Validation 创建自己的错误检查器:

Many years late, but you can create your own error checker using DocumentFormat.OpenXml.Validation: https://msdn.microsoft.com/en-us/library/office/bb497334.aspx

这篇关于是否有任何docx修复工具会给出有意义的错误消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆