字处理 - 包或字的问题无法打开生成的文件 [英] Wordprocessing - Problem with package or word can't open generated File
本文介绍了字处理 - 包或字的问题无法打开生成的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
ich已经用ABAP语言编写了一个用于生成docx
文件的工具。它工作正常,但word无法打开生成的文件。我在网上搜索了
的工具,它可以验证OOXML文件,并且在打开文档sdk上只找到了三个
方法,可以做到这一点。我写了一个小的
代码并测试了我生成的文件。结果是以下
异常:
Hello,
ich' ve written a tool in ABAP language for generating docx
files. It works fine, but word cannot open generated files. I searched
the web for a tool, which can validate OOXML files and found only three
methods on the open document sdk, which can do that. I wrote a small
code and tested my generated file. The result is the following
exception:
在MS.Internal.IO.Zip.ZipIOEndOfCentralDirectoryBlock.FindPosition(Stream archiveStream) |
在MS.Internal.IO.Zip.ZipIOBlockManager.LoadEndOfCentralDirectoryBlock上的MS.Internal.IO.Zip.ZipIOEndOfCentralDirectoryBlock.SeekableLoad(ZipIOBlockManager blockManager) |
) |
在MS.Internal.IO.Zip.ZipArchive..ctor(Stream archiveStream,FileMode模式) ,FileAccess的访问,Boolea Ñ流,布尔ownStream) |
在MS.Internal.IO.Zip.ZipArchive.OpenOnFile(字符串路径,的FileMode模式,FileAccess的访问,文件共享份额,布尔流) |
(字符串路径,FileMode模式,FileAccess访问,FileShare份额,布尔流) |
在System.IO.Packaging.Package.Open(字符串路径,的FileMode packageMode,FileAccess的packageAccess,文件共享packageShare,布尔流) |
在System.IO.Packaging.Package.Open(String path,FileMode packageMode,FileAccess packageAccess,FileShare packageShare)在DocumentFormat.OpenXml.Packaging.OpenXmlPackage.OpenCore(String path,Boolean readWriteMode) |
(247,247,247)">在DocumentFormat.OpenXml.Packagi ng.WordprocessingDocument.Open(字符串路径,布尔readWriteMode) |
在WindowsFormsApplication1.Form1.ValidateSimplePackage(字符串docxFile)在C:\Documents和Settings\Tester\Local设置\Application Data \Temporary Projects \ WindowsFormsApplication1 \Form1.cs:第30行 |
at MS.Internal.IO.Zip.ZipIOEndOfCentralDirectoryBlock.FindPosition(Stream archiveStream) |
at MS.Internal.IO.Zip.ZipIOEndOfCentralDirectoryBlock.SeekableLoad(ZipIOBlockManager blockManager) |
at MS.Internal.IO.Zip.ZipIOBlockManager.LoadEndOfCentralDirectoryBlock() |
at MS.Internal.IO.Zip.ZipArchive..ctor(Stream archiveStream, FileMode mode, FileAccess access, Boolean streaming, Boolean ownStream) |
at MS.Internal.IO.Zip.ZipArchive.OpenOnFile(String path, FileMode mode, FileAccess access, FileShare share, Boolean streaming) |
at System.IO.Packaging.ZipPackage..ctor(String path, FileMode mode, FileAccess access, FileShare share, Boolean streaming) |
at System.IO.Packaging.Package.Open(String path, FileMode packageMode, FileAccess packageAccess, FileShare packageShare, Boolean streaming) |
at System.IO.Packaging.Package.Open(String path, FileMode packageMode, FileAccess packageAccess, FileShare packageShare) |
at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.OpenCore(String path, Boolean readWriteMode) |
at DocumentFormat.OpenXml.Packaging.WordprocessingDocument.Open(String path, Boolean readWriteMode) |
at WindowsFormsApplication1.Form1.ValidateSimplePackage(String docxFile) in C:\Documents and Settings\Tester\Local Settings\Application Data\Temporary Projects\WindowsFormsApplication1\Form1.cs:line 30 |
推荐答案
你好,我查看了你的文件。在[Content_Types] .xml中,如果删除以下行:
< Default Extension =" xml" ContentType =" application / xml" />
然后Word可以打开此文档。
希望这会有所帮助。
BTW,我在SDK团队工作。如果您可以帮助我们更好地了解您的情景,将会非常有帮助。请随时通过 lanqingd@hotmail.com 与我联系。我们有一个连接站点,提供有关如何使用SDK的更多帮助文档 - http:// connect。 microsoft.com/site/sitehome.aspx?SiteID=589 。我们也欢迎您通过连接网站向我们发送有关SDK的反馈。
问候,
--L。
Hi there,
I looked at your file. In [Content_Types].xml, if you remove the following line:
<Default Extension="xml" ContentType="application/xml"/>
Then Word could open this document.
Hope this helps.
BTW, I work on the SDK team. It will be very helpful if you could help us to understand your scenaio better. Please feel free to connect me through lanqingd@hotmail.com. We have a connect site to provide more help documents on how to use the SDK -- http://connect.microsoft.com/site/sitehome.aspx?SiteID=589 . You are welcome to send us your feedback about the SDK through the connect site as well.
Regards,
--L.
这篇关于字处理 - 包或字的问题无法打开生成的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文