That works in 2010... for earlier versions, you'll need to replace "sub" with "function"

-tg