I can't provide you with a file to reproduce the error (it doesn't fail before replacing the text) but I think the stacktrace speaks for itselve.
I've tested using:
Spire office 2.8.2 Spire Doc 5.1.13.4035
.NET 3.5, Windows 10, Office 2013
I've tried newer Spire versions, but they get another Argument out of range exception, see this support thread.
Thank you,
Robin
- Code: Select all
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.Generic.List`1.System.Collections.IList.get_Item(Int32 index)
at Spire.Doc.Collections.ParagraphItemCollection.get_Item(Int32 index)
at Spire.Doc.Hyperlink.3()
at Spire.Doc.Fields.Field.Spire.Doc.Layout.IDocumentWidget.Measure(spr6057 dc)
at spr1416.0(RectangleF A_0)
at spr7818.3(spr6757 A_0)
at spr7818.0(RectangleF A_0)
at spr7317.3(spr6757 A_0)
at spr7818.0(RectangleF A_0)
at spr7818.3(spr6757 A_0)
at spr7818.0(RectangleF A_0)
at spr7818.3(spr6757 A_0)
at spr7818.0(RectangleF A_0)
at spr5372.0(spr6066 A_0, spr5242 A_1, spr6057 A_2)
at spr4071.18()
at spr4071.1(IDocument A_0)
at spr2232.0(Document A_0)
at Spire.Doc.Document.0(Stream A_0)
at Spire.Doc.Document.SaveToFile(Stream stream, FileFormat fileFormat)
at ...