【问题标题】:The Office Open XML file Can not be open because there are problems with contents How To FixOffice Open XML 文件无法打开,因为内容存在问题 如何修复
【发布时间】:2023-04-04 21:51:02
【问题描述】:

我正在使用此功能写入文件。当打开我的文件时 MS Office 显示弹出窗口 Office Open XML 文件无法打开,因为内容存在问题 如何修复

zszFilePath = Path.Combine(xszAttachmentPath, xszInternalFileName); FileStream zfsSourceFile = new FileStream(zszFilePath, FileMode.Open); znFileSize = (int)zfsSourceFile.Length; 字节[] zbGetContent = 新字节[znFileSize]; zfsSourceFile.Read(zbGetContent, 0, znFileSize); zfsSourceFile.Close(); zObjContext.Response.BinaryWrite(zbGetContent);

【问题讨论】:

  • 如果内容有问题,那么您应该修复内容吗?该错误实际上是通俗易懂的英语......你为什么要问?
  • 内容没有问题

标签: c# asp.net telerik ms-office


【解决方案1】:

使用 OpenXMLValidator 验证您以 Open XML 格式创建的文档。有了它,您还可以测试以查看文件有什么问题。

更多信息请阅读博文

Validate Open XML Documents using the Open XML SDK 2.0

Finding Open XML Errors with Open XML SDK Validation

希望对您有所帮助。如果不是,请提供您尝试打开的文件或对其中的内容更具描述性。当前信息太有限,无法正确回答。

【讨论】:

    猜你喜欢
    • 2018-06-28
    • 2011-04-21
    • 1970-01-01
    • 1970-01-01
    • 2023-03-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多