I have moved the macro I posted above to a new topic in the "macro" category:
For more information, see the wiki Searching the Forum for Answers section.