Tom, take a look at this thread/macro. It should give you some ideas.
For more information, see the wiki Searching the Forum for Answers section.