Sunday 28 September 2014

Select List

A Free Document Productivity Tool for Word

This tool selects an entire bulleted or numbered list ready for further editing or formatting.

It is based on code used by SmartPunctuation, a tool that automatically punctuates a bulleted or numbered list.

The instructions are relatively simple, place the cursor anywhere in the list and select the shortcut key.  The list will then be selected.

The key selection routine used for Select List is also used for by SmartPunctuation. The routine has a number of special features

Handle bulleted lists inside tables. 

The routine must recognise cell boundaries and not select list entries outside the current cell.  

It must also handle quirky way that Word used to mark the end of a cell boundary.

Handle Bulleted lists in numbered paragraphs

The routine must work within the context of a document whose body uses numbered paragraphs, a form of numbered list.  This means that the routine must detect changes in list format within a range of text that is itself a bulleted list.


Since the selection routine is used for several tools, here are some details for the folk interested in VBA
  1. If there is text selected, collapse any selection to an insertion point at the start point
  2. Check that the  selected text is in a bulleted list.  This means checking the selection range's formatting attributes
  3. If the selection is in a table, remove any trailing blank lines in the cell, and then find the index number of the final paragraph so that the final selection can treat end of cell in a special way.
  4. Determine the index number of the first and last paragraph in the list. From the current position, step through each successive previous paragraph and check that it has the same list formatting as the current, when it changes, stop.  Similarly, from the initial start point, check successive paragraphs until the formatting changes, then stop.
  5. Once the paragraph range is found select the paragraphs between.  Where the final paragraph is the end of a cell, dont select the entire last paragraph, select all characters in it except the final one.
Occasionally, I'll want to change the formatting of a bulleted list.  This routine is a quick way to do so.

Shortcut Keys

The suggested shortcut key is Alt+z.  

I have chosen this combination as it allows me to keep my right hand on the mouse, and it complements a number of other quick selections which I will publish in a later post.

UPDATE: May 2016
I have redesigned this tool to select more that just lists. SmartSelect tries to be intuitive about what you want to select, whether a work, row, paragraph or list.
SmartSelect should be published in July 2016.

No comments:

Post a Comment

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