Free Support Forum - aspose.com

How to determine if a word table row cell is using autosequence

Hi,

I am using aspose.net to merge word templates with dynamic data. I need to iterate thru word table rows in my document, and find if a particular cell/cells in the row has any kind of autosequence numbering assigned to it. It is important to note that the sequencing may be like 1. 2. OR a. b. OR 1A. 1B. etc. (normal word sequncing allowed from office menu)

Please see the scheudo code I am using currently:

// Get all rows in the document.

Node[] rows = doc.GetChildNodes(NodeType.Row, true).ToArray();

foreach (Row row in rows)

{

foreach (Cell cell in row.Cells)

{

//HOW to determine if a cell has any kind of autosequence numbering assigned to it???

???????

}

}

Any help or hint for this is greatly appreciated.

Thx

Thanmal.

Hi

Thanks for your request. Could you please attach a sample document here for testing? We will check it and provide you more information.

Best regards,

Attaching the sample document. As you can see the 2nd column/cell has a sequence numbering assigned to it. In this case it follows the pattern of 1. 2. and so on.. In other cases the numbering may follow a. b. c. etc. or any other autosequence numbering from office menu.

I need to go thru the table, find the TRUE empty row by ignoring any autosequence column, and removing the row. I was thinking of going thru all rows, all cells within the row and then if all cell values (ignoring the autosequence cell) in a given row is emptyornull then I will remove it from the document.

Let me know in case of further questions/clarifications.

Thx

Thanmal.

Hi

Thank you for additional information. In your case numbering in the table cells is simple numbering applied to the paragraph in this cell. So you simply need to check whether a paragraph in the table cell is list item:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/aspose.words.paragraph.islistitem.html

If you need get information about numbering style, you shoul check ListFormat:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/aspose.words.paragraph.listformat.html

Best regards,

That worked!

Thx a lot for your help.

Thanmal.