Necessity is the Mother of Discovery
In The Republic, Plato said "…the true creator is necessity, who is the mother of our invention." Over the years, this phrase morphed into the idiom "necessity is the mother of invention." I've found that when working with a product as rich as Word, this wisdom turns into "necessity is the mother of discovery."
For example, one of the projects we worked on during 2007 was writing the Word 2007 version of Rich Text Format (RTF) specification. I mention this because it was during this project that we needed and therefore discovered three little-known but very handy table features in Word:
- Repeating Headers
- Sorting
- Table Properties
<aside>I'm not being cute when I say we "discovered" these. Not every member of the Word team is an expert in each of the 1,700 or so commands in Word 2007. Put it this way: We have table experts on the Word team, but not everyone on the Word team is a table expert.</aside>
If you have ever had the pleasure of reading the Word 2007 RTF spec cover-to-cover, you know that Appendix B contains a forty-plus page table. It's a massive three column table describing everything you can do with RTF (column 1), listing where each of those things are covered in the spec (column 2), and slotting each of those things into a "type" category (column 3).
As you might guess, our work on the spec culminated in adding all the new Word 2007 stuff to this table and reporting how much stuff you could now do with RTF.
Adding pages of new rows to a very specifically formatted alphabetized forty-plus page table necessitated either discovery or insanity. Fortunately we discovered repeating headers, sorting, and table properties.
Repeating Headers
This one is easy and made pages two through forty-four of the table easier to work with. Specifically, when we repeated headers, we could see the header row of the table at the top of every page the table spanned.
For example, here are pages two and three of the table with headers repeating and then the same pages without headers repeating:
Header Rows Repeating
Header Rows Not Repeating
As you can see, the header row is at the top of every page the table spans when you repeat header rows. Conversely, the header row is not shown when you don't repeat header rows. We liked the clarity added by repeating header rows and selected it like this:
Sorting
While repeating header rows was pretty nice, we discovered a diamond by sorting the contents of this very strictly formatted table right in Word.
Here was the issue we faced. The Word 2007 RTF spec builds off of the Word 2003 spec. That means that creating the 2007 spec means adding all the stuff new to 2007 to the 2003 spec, and then changing the title of the spec. The formatting and layout of the spec must stay the same.
Part of this is updating the giant table in Appendix B with pages and pages of new rows. And of course, the table is in alphabetical order. So, we could:
- Meticulously insert each new row one-by-one in alphabetical order. Very lame.
- Add a bunch of new rows at the end of the table. Copy the entire table into Excel. Use Excel's sorting functionality. Paste the table back into the spec. Reformat it to look exactly like the table in the 2003 spec. Lame.
- Add all the 2007 stuff to the end of the table. Click sort. Not lame.
We chose the latter and had time to enjoy one of the three sunny days we had here in Redmond, WA last year.
Table Properties
Actually, before we headed out, we wanted to know how much new stuff we documented and the total amount of stuff in the 2007 version of the spec. We could leverage the monster table to do in one of three ways:
- Make sure header rows aren't repeating and count the number of rows in the table from the Word 2003 RTF spec (amount of existing stuff). Make sure header rows aren't repeating and count the number of rows in the table from the Word 2007 RTF spec (total amount of stuff). Subtract the amount of existing stuff from the total amount of stuff to get the amount of new stuff. Cry while typing up the email reporting the amount of new and total stuff.
- Make sure header rows aren't repeating. Paste the table from the Word 2003 RTF spec into Excel. Note the number of rows and subtract one to account for the header row (amount of existing stuff). Paste the table from the Word 2007 RTF spec into Excel. Note the number of row and subtract one to account for the header row (total amount of stuff). Subtract the amount of existing stuff from the total amount of stuff to get the amount of new stuff. Sigh while typing up the email reporting the amount of new and total stuff.
- Right click in the last row of the tables in the 2003 and 2007 specs. Click Table Properties and select Row. Note the row number and subtract one to account for the header row. Subtract the amount of existing stuff from the total amount of stuff to get the amount of new stuff. Smile while typing up the email reporting the amount of new and total stuff.
So we faced a nearly fifty-page table and necessary discovery or necessary insanity. We discovered repeating headers, sorting, and table properties, and thus I'm able to chat with you today.
-Jonathan