In Visual Studio (2008) there a command to collapse/expand all the sections of code in a file?
If you mean shortcut then
CTRL + "M" + "M": This one will collapse the region your cursor is at whether its a method, namespace or whatever for collapsing code blocks, regions and methods. The first will collapse only the block/method or region your cursor is at while the second will collapse the entire region you are at.
http://www.dev102.com/2008/05/06/11-more-visual-studio-shortcuts-you-should-know/
CTRL + M + O will collapse all.
CTRL + M + L will expand all.
CTRL + M + P will expand all and disable outlining.
CTRL + M + M will collapse/expand the current section.
These options are also in the context menu under Outlining.
* Fold/Unfold the current code block – Ctrl+M, Ctrl+M
* Unfold all – Ctrl+M, Ctrl+L
* Stop outlining – Ctrl+M, Ctrl+P
* Fold all – Ctrl+M, Ctrl+O
Are you refering to the toggle outlining?
You can do Control-M then Control-L for toggle all outlining
CTL+M+L expands all CTL+M+O collapses all
Check here if you're looking for other shortcuts - these 2 are just a few of the many that are available.