Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Sun Mar 03, 2024 5:16 pm

Hi again!
A few hours ago I posted the question how to read a word document with table(s) sequentially, i.e. paragraph by paragraph or whatever document object you have in that document. After that I found an example similar to my question, changed a bit and got the code below

For Each oSection In Me.coDoc.Sections
For Each oDocumentObject In oSection.Body.ChildObjects
cvChildObjectsCount = cvChildObjectsCount + 1

sDOT = oDocumentObject.GetType.ToString
Select Case sDOT
Case "Spire.Doc.Documents.Paragraph"
'do things

Case "Spire.Doc.Table"
'do things

Case Else

End Select

Next 'ChildObject

Next 'Section

This allows me to iterate through my document and get values from a paragraph or from a table. I thought I had found the solution but the walkthrough stops about a third of the way through the document. There will be no error, but both Body.ChildObjects and Sections will run out and the loops end. The rest of the document is similar to the first third so I can't see any reason why the items would run out. I am using FreeSpire.doc, is there a limitation there?

Grateful for answers

nagy53janos
 
Posts: 2
Joined: Sun Jan 26, 2020 3:23 pm

Mon Mar 04, 2024 6:14 am

Hello,

Thank you for your inquiry.
Please note that our free version of Spire.Doc has limitations of 500 paragraphs or 25 tables. If either of these limits is exceeded, the program will terminate abruptly. Therefore, I recommend using our commercial version, Spire.Doc (Spire.Doc Pack (hot fix) Version: 12.2.10), which includes more fixes and new features compared to the free version, albeit with a watermark warning.
If you want to remove the warning watermark and other limitations, we can offer you a free one-month temporary license, please apply through this link:https://www.e-iceblue.com/TemLicense.html

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1651
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.Doc