I suddenly do get a strange "ArgumentOutOfRangeException"-error when I want to count the numbers of pages in a document using GetPageCount.
The weird part is, that I do only add a Table to the document. I put in some message boxes to determine the exact line. Here my code snippet:
- Code: Select all
Aktuelle_TabelleNr = Zieldokument.Sections(Aktuelle_Sektion).Tables.Count
MsgBox(Dokument.GetPageCount)-----------> Here it still works
Zieldokument.Sections(Aktuelle_Sektion).AddTable()
MsgBox(Dokument.GetPageCount)-----------> Thats were I get the error
Dim Tabelle As Table = Zieldokument.Sections(Aktuelle_Sektion).Tables(Aktuelle_TabelleNr)
The message StackTrace contains:
bei System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
bei System.Collections.Generic.List`1.System.Collections.IList.get_Item(Int32 index)
bei Spire.Doc.Collections.RowCollection.get_Item(Int32 index)
bei spr6131.1()
bei spr6131..ctor(Paragraph A_0)
bei Spire.Doc.Documents.Paragraph.CreateLayoutInfo()
bei Spire.Doc.DocumentBase.Spire.Doc.Layout.IDocumentBase.get_LayoutInfo()
bei spr10261.2(Paragraph A_0)
bei spr10261.5(spr8883 A_0)
bei spr10261.10(spr8883 A_0)
bei spr10261.0(RectangleF A_0)
bei spr10261.4(spr8883 A_0)
bei spr10261.0(RectangleF A_0)
bei spr5861.0(spr7972 A_0, spr6881 A_1, spr7961 A_2)
bei spr5310.18()
bei spr5310.0(Document A_0)
bei Spire.Doc.Document.59()
bei Spire.Doc.Document.GetPageCount()
Do you need any more Details?
Best Regards
Christoph