This project has moved and is read-only. For the latest updates, please go here.

DocX can't open Microsoft Word 97 - 2003 Document (.doc)

Feb 18, 2014 at 2:10 PM
i try open file word (.doc) but DocX can't :(
string FolderName = Directory.GetCurrentDirectory();
string FileName = FolderName + "\\Template\\TPB_BM05.doc";
var doc = DocX.Load(FileName);
That's error...
Unhandled Exception: System.IO.FileFormatException: File contains corrupted data
.
at MS.Internal.IO.Zip.ZipIOEndOfCentralDirectoryBlock.FindPosition(Stream arc
hiveStream)
at MS.Internal.IO.Zip.ZipIOBlockManager.LoadEndOfCentralDirectoryBlock()
at MS.Internal.IO.Zip.ZipArchive.OpenOnStream(Stream stream, FileMode mode, F
ileAccess access, Boolean streaming)
at System.IO.Packaging.ZipPackage..ctor(Stream s, FileMode mode, FileAccess a
ccess, Boolean streaming)
at System.IO.Packaging.Package.Open(Stream stream, FileMode packageMode, File
Access packageAccess, Boolean streaming)
at Novacode.DocX.Load(String filename)
Feb 19, 2014 at 11:59 AM
Hi!

DocX is a .NET library that allows developers to manipulate Word 2007/2010 files, in an easy and intuitive manor.