Creating a table with a numbered list in the first column

B

Bryhhh

Using C# (VS2005 and Word 2003), I'm attempting to create a table with
a numbered list in the first column of each row in the following
format:

1.1 abc xyz
1.2 abc xyz
1.3 abc xyz
1.4 abc xyz
....
1.10 abc xyz
etc.

So far I've only managed to create a table as follows

1. abc xyz
2. abc xyz
3. abc xyz
etc.

I've spent over a day working on trying to change the format of the
list, but I just can't crack it. Many of the properties that seem to
control the list format are read only. I've sifted through countless
MSDN, Newsgroup and web articles, (most of which are for VBA), but
everything I have tried so far has failed to work.

My code currently is as follows

// This code inserts a number list into the first column of
// each row, in the format 1., 2., 3., etc.
// The 'table' object represents the table I'm manipulating
// 'rows' represents the number of rows in the table
Object objNumList = "List Number";
for (int i = 1; i <= rows; i++)
table.Cell(i, 1).Range.set_Style(ref objNumList);

For information, after the first table, I will want to create further
tables, that will use the number list format of 2.1, 2.2, 2.3, etc.
and then 3.1, 3.2, 3.3, etc.
 
B

Bryhhh

Using C# (VS2005 and Word 2003), I'm attempting to create a table with
a numbered list in the first column of each row in the following
format:

1.1 abc xyz
1.2 abc xyz
1.3 abc xyz
1.4 abc xyz
...
1.10 abc xyz
etc.

So far I've only managed to create a table as follows

1. abc xyz
2. abc xyz
3. abc xyz
etc.

I've spent over a day working on trying to change the format of the
list, but I just can't crack it. Many of the properties that seem to
control the list format are read only. I've sifted through countless
MSDN, Newsgroup and web articles, (most of which are for VBA), but
everything I have tried so far has failed to work.

My code currently is as follows

// This code inserts a number list into the first column of
// each row, in the format 1., 2., 3., etc.
// The 'table' object represents the table I'm manipulating
// 'rows' represents the number of rows in the table
Object objNumList = "List Number";
for (int i = 1; i <= rows; i++)
     table.Cell(i, 1).Range.set_Style(ref objNumList);

For information, after the first table, I will want to create further
tables, that will use the number list format of 2.1, 2.2, 2.3, etc.
and then 3.1, 3.2, 3.3, etc.

There is more than one way to skin a cat...

Instead, I've done this by pre-creating the tables with the number
list in the first row of each table. I now simply add another row to
the table and the number list magically appears in the new row.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top