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

Noob Error

Jun 9, 2009 at 6:10 PM

Hello Cathal,

I have the following code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DocumentFormat.OpenXml;
using Novacode;

namespace testApp
{
    class Program
    {
        static void Main(string[] args)
        {
            DocX document = DocX.Load(@"c:\test.docx");
            document.Close(true);
        }
    }
}

when I try to compile this app, I get the following error: http://www.freeimagehosting.net/image.php?8c46c902a1.jpg

I have the DLL referenced and installed the Office 2007 SDK and everything seems fine.

Would appreciate help. Thanks!

Jul 1, 2009 at 9:21 PM

Hello cygnus2936,

Sorry it took me so long to reply. I have moved house and job this month, so I have not been very active with DocX.

It seems like the document is not a valid .docx file. Can you send me a copy of the document you are trying to load? You can email it to coffey.cathal@gmail.com. Can you also try creating a new document using Office 2007 and loading that instead.

kind regards,
Cathal

Jul 3, 2009 at 9:45 AM

Hello again cygnus2936,

someone else reported a very simular error a few months ago. I think your problem is that you are using an old version of the OOXML SDK. Please download the newest version of DocX (v1.0.0.5). This and later versions of DocX, no longer have a dependency on the OOXML SDK.

kind regards,
Cathal