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

Problem opening docx file containing jpeg?

Jun 29, 2010 at 4:38 PM

Should I be able to open a docx file containing a jpeg? If I try I get a NullReferenceException "Object reference not set to an instance of an object."

Any ideas? I've just tried this with a brand new docx and jpeg straight from the internet (I used you doc x logo converted to jpeg in mspaint) and it's failing?

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using Novacode;

namespace DocxLearning
    class Program
        static void Main(string[] args)
            using (DocX doc = DocX.Load("testpic.docx"))


Jun 29, 2010 at 4:40 PM

I've just tried a different docx with many jpegs in and get an InvalidOperationException "Sequence contains more than one element". Same code as above.

Any ideas?

Jun 30, 2010 at 11:46 AM

I am not able to reproduce the issue on my side. Can you please send me a docx file that causes this error? I will test it with your code and try to find the problem.

kind regards,