This is what I was trying to base this macro off of.
For more information, see the wiki Searching the Forum for Answers section.