Hi – I am trying to read tables from the Word file. Somtimes ASPOSE does to see the table. Can anybosy help? Here is the code I am using:
public static System.Collections.Generic.List<Row> GetRows(Stream ioStream)
{
//Return a collection of rows.
//Sometimes its necessary to parse ahead to the next row but this is hard to do if the next row may or may
//not be in the next table. Pushing all of the rows into a single row collection solves the problem.
ArrayList alist = new ArrayList();
Aspose.Words.Table tbl; System.Collections.Generic.
List<Row> rows = new System.Collections.Generic.List<Row>();
if (ioStream.Length == 0) return (null); Aspose.Words.
Document doc = new Document(ioStream);
for (int n = 0; n < doc.Sections.Count; n++) //for each section
{
for (int i = 0; i < doc.Sections[n].Body.Tables.Count; i++) //for each table
{
tbl = doc.Sections[n].Body.Tables[i];
for (int j = 0; j < tbl.Rows.Count; j++) // for each row
{
rows.Add(tbl.Rows[j]);
}
}
}
return rows;
}
This message was posted using Aspose.Live 2 Forum