Traversing cells in Word

Technical support for Spire.Doc

Moderator: iceblue support

Traversing cells in Word

Postby moonsky » Tue Jan 11, 2011 6:47 am

Hello,
Once I got a Word document from my friend, there are some tables in it. I want to know how many cells are there in these tables. To get the information, how can I traverse the cells of a table in Word document?
Can you offer me any advices?
THANKS!
moonsky
 
Posts: 9
Joined: Mon Dec 13, 2010 7:39 am

Re: Traversing cells in Word

Postby iceblue support » Wed Jan 12, 2011 3:39 am

Thank you for your inquiry.
You can use Spire.DOC to accomplish it:
//Get the table object
Spire.Doc.ITable table = section.Tables[0];
//Loop through all rows:
foreach (TableRow row in tableRows)
{
//Loop through all cells
foreach (TableCell cell in tableCells)
{
//do something...
}
}
e-iceblue support
User avatar
iceblue support
 
Posts: 244
Joined: Tue Dec 21, 2010 2:56 am


Return to Spire.Doc

Who is online

Users browsing this forum: No registered users and 0 guests