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.

Fri Jan 21, 2022 9:20 am

Hi
I have a problem with finding numbers inside table cells in a word document

Generally I no problem finding text inside specific cells. Normally i can find text inside a cell going through "cell".ChildObject.Text

However my problem is that certain cells contain numbers that are NOT defined as text but automatically numerated in word (attached a picture with an example)

Im able to pull out all the text from the table except "1" "2" "3" "4" "5" because its not defined as text inside the table. The "cell".ChildObject.Text path is empty in those specific cells

How do i find these values inside the table?

Thanks

worldjones
 
Posts: 4
Joined: Fri Jan 21, 2022 9:08 am

Fri Jan 21, 2022 9:46 am

Hello,

Thanks for your inquiry!

I simulated a Word file and extract text with "TableCell.FirstParagraph.Text;", but did not reproduce your issue. To help us better investigate your issue, could you please provide us with your input file? You can also send it to us via email(support@e-iceblue.com). Thanks in advance!

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Fri Jan 21, 2022 10:02 am

Hi

I have attached a word document with an example table.

When i go to "TableCell.FirstParagraph.Text" the text string is empty (attached picture)

worldjones
 
Posts: 4
Joined: Fri Jan 21, 2022 9:08 am

Mon Jan 24, 2022 1:22 am

Hello,

Thanks for sharing more information, and sorry for the late reply as weekend.

After further investigate your file, I found that the text "1" is a list text in fact. Please refer to the following code to get the list text of the paragraph.
Code: Select all
            Document document = new Document();
            document.LoadFromFile(@"E:\testdoc\Test2\Test2.docx");
            TableCell cell = document.Sections[0].Tables[0].Rows[2].Cells[0];
            string text2 = cell.Paragraphs[0].ListText;

If you have any question, just feel free to contact us.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Wed Feb 09, 2022 7:10 am

Hello,

Hope you are doing well!

Has the issue been solved now? Could you please give us some feedback at your convenience?

Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Wed Feb 09, 2022 11:54 am

Hi. Yes my issue was resolved after trying the way you told me to :)

Thanks a lot

worldjones
 
Posts: 4
Joined: Fri Jan 21, 2022 9:08 am

Thu Feb 10, 2022 1:12 am

Hello,

Thanks for your feedback!

Glad to hear that your issue has been solved.

If you encounter any issues related to our product in the future, just feel free to contact us.

Have a nice day!

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Return to Spire.Doc