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

Bug in DocX.Load(String filename) version

Jun 29, 2010 at 3:36 AM


I got exception when using new version at DocX.Load

System.NullReferenceException was unhandled by user code
 "Object reference not set to an instance of an object."

And here is error in Paragraph.cs file:

public List<Picture> Pictures
List<Picture> pictures =
from p in Xml.Descendants()
where (p.Name.LocalName == "drawing")
let id =
from e in p.Descendants()
where e.Name.LocalName.Equals("blip")
select e.Attribute(XName.Get("embed", "")).Value
let img = new Image(Document, mainPart.GetRelationship(id)) -> Object reference not set to an instance of an object
select new Picture(Document, p, img)

return pictures;

I haven't found any solution yet.


Jun 29, 2010 at 9:56 AM
Hi dienhs,

please send me the file and the code used to reproduce this error.

Jul 4, 2010 at 9:26 PM
Edited Jul 4, 2010 at 9:26 PM


I'm having the same problem. Can't load documents. Sending you email with docx that causes problems (I've got lots of them like that).

With regards,


Jul 30, 2010 at 3:19 PM
Edited Jul 30, 2010 at 3:21 PM

Sorry - wrong place...