Quantcast
Channel: Open XML Format SDK forum
Viewing all articles
Browse latest Browse all 1288

Wordprocessing - Problem with package or word can't open generated File

$
0
0
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:


  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 


There is a problem with the package, more exact with the zip directory. I downloaded a PKZIP® for Desktop from PKWARE and opened my generating file without any problem! You can download an example of generated file here: Wordprocessing Exmaple This file cannot open a word 2007 or a word 2003 with compatibility pack, but a openoffice 2.4 can open this!

Does anybody ha any idea?


Viewing all articles
Browse latest Browse all 1288

Trending Articles