Sunday 23 November 2014

SmartTable Number Update

A Free Document Productivity Tool for Word

There have been a number of improvements to SmartTable Number, the tool that renumbers and tidies tables in Word.

The highlights are:
  • Ability to handle multi-row headers.
  • Suffix codes e.g “7a, 7b, 7c..” added for rows that follow from the one above.
  • Continue numbering from a previous table.

Handle Multi-row headers

SmartTable Renumber is designed to start numbering from the first row after the header. Previously, only single row headers were supported. Having worked on some complex tables lately, I added logic to handler multi-row headers.

You can now use the “Repeat Header Rows” option in the Table Layout tab to define multi-row headers. Numbering will start from the first regular row after the header.

Using the "Repeat Header Rows" sets a flag on each header that ensures the header gets repeated on each page.  The numbering routine tests for this flag and skips header before starting to assign numbers.

Suffix Codes

The routine now numbers rows that have a blank cell in column 2.  It does this by appending “a, b, c…” to the previous row number.  

In this example, since there is no text in column two, the routine has added the suffix a, b, c... to the previous row. 

To switch this on, a new entry in the table control list has been added.  A value of S adds this suffix.  If a value of “N” is entered, rows with a blank column 2 are not numbered.

I needed this logic to handle some complicated tables where the second cell was sometimes a header for several rows that follow.

Continue numbering from a previous table

To continue numbering from the previous table type ”-1” in the first number cell and then select SmartTable Number.

The routine will go to the previous table and get the last number (and prefix, if any) from the previous table and continue numbering.

The “-1”refers to the number of tables to go back, If you type “-2”, the routine will get the number and any prefix from the table before the previous one.  This allows me to insert small tables between the main numbering sequence

In this example -1 has been added to the first row of the second table.  

After selecting SmartTable Number, the numbering from the previous table has been copied down.

I needed this logic to handle several tables that needed to have a common numbering. 

The routine is not smart enough to automatically renumber a series of tables, you have to do them one at a time. This isn't a limitation of coding, its more of a limitation in the way Word works. There are no spare fields in the table properties to permanently store the relationship between tables, this makes building repeatable process tricky.


This is an update to SmartTable Number.  The latest copy of all Tool code can be found in the Downloads tab.

No comments:

Post a Comment

Please add comments, encouragement and suggestions. You can be anonymous if you want.