# How to expand multiple cells at once?

Is there a simple way to expand multiple cells simultaneously?

At the moment I am primarily interested in fully expanding "in one fell swoop" all the cells in a documentation window, although I can imagine situations in which I'd want to open several cells only one-level deep, so I'm interested in this case as well. Finally, it would also be useful to know how to collapse multiple cells at once.

EDIT: My immediate interest is for ways to do this interactively, rather than programmatically. I.e. keyboard (+ mouse) shortcuts, or (second best), menu commands.

-

There are a range of commands that allow you to programmatically control the front end. For example

FrontEndExecute[{FrontEndToken[InputNotebook[], "SelectAll"]}];
FrontEndExecute[{FrontEndToken[InputNotebook[], "SelectionOpenAllGroups"]}];


selects all the cells and opens them.

NotebookFind[InputNotebook[], "Output", All, CellStyle];
FrontEndExecute[FrontEndToken[InputNotebook[], "SelectionCloseUnselectedCells"]];


May also be of use. The places to look for help about these kind of commands is FrontEndToken and the tutorial or this help page.

-
Bill, you missed a couple o'spaces :) –  Sektor Sep 20 '13 at 16:04
Thanks! I was actually looking for interactive commands (though I did not make that very clear in my original post). Your answer, however, gave me enough to search with. I found what I was looking for (namely, Ctrl + {) under Cell > Grouping. –  kjo Sep 20 '13 at 19:34