There are a couple of ways that you can do what it sounds like you are looking to do:
Both of these are documented fairly extensively in Help > Contents