I've upgraded to the newest version, Spire.Office 2.12.5 (Spire.Doc 5.5.114.4035). I'm using the .NET 3.5 version of the dlls.
When opening a .docx that contains a citation, the Document constructor throws a NullReferenceException, see attached docx, code and stacktrace below.
Thank you
- Code: Select all
using Spire.Doc;
Document document = new Document(@"C:\Users\user\Desktop\citation.docx");
- Code: Select all
System.NullReferenceException occurred
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=Spire.Doc
StackTrace:
at Spire.Doc.Fields.Field.2(Paragraph A_0)
at Spire.Doc.Fields.Field.1(Paragraph A_0)
at spr2184.0(ParagraphItemCollection A_0)
at spr2184.6(XmlReader A_0, ParagraphItemCollection A_1)
at spr2184.0(XmlReader A_0, ParagraphItemCollection A_1, Boolean A_2, Boolean A_3, spr1893 A_4)
at spr2184.9(XmlReader A_0, ParagraphItemCollection A_1)
at spr2184.17(XmlReader A_0, ParagraphItemCollection A_1)
at spr2184.0(XmlReader A_0, SDTInlineContent A_1)
at spr2184.0(XmlReader A_0, StructureDocumentTagInline A_1)
at spr2184.17(XmlReader A_0, ParagraphItemCollection A_1)
at spr2184.14(XmlReader A_0, IDocumentObject A_1)
at spr2184.13(Stream A_0)
at spr2184.2(spr1053 A_0)
at spr2184.1(Document A_0)
at spr2184.1(Stream A_0, Document A_1)
at Spire.Doc.Document.13(Stream A_0)
at Spire.Doc.Document.LoadFromStream(Stream stream, FileFormat fileFormat, String password)
at Spire.Doc.Document..ctor(Stream stream)
at ..... .SpireTemplate.Transform(Stream input, Stream output, FileFormat fileFormat) in C:\ ..... SpireTemplate.cs:line 80
InnerException: