You might take a look at this macro, and adapt it for your needs.
For more information, see the wiki Searching the Forum for Answers section.