There's a nice example in Appendix E of the TeXbook, where a letter format is described. A few lines of a possible letter:
\address
Prof.~Brian~K. Reid
Department of Electrical Engineering
Stanford University
Stanford, CA 94305
\body
Here, \address
and \body
are defined as follows:
\def\address{\beginlinemode\getaddress}
{\obeylines\gdef\getaddress #1
#2
{#1\gdef\addressee{#2}%
\global\setbox\theaddress=\vbox\bgroup\raggedright%
\hsize=\longindentation \everypar{\hangindent2em}#2
\def\endmode{\egroup\endgroup \copy\theaddress \bigskip}}}
\def\body{\beginparmode}
\def\beginparmode{\endmode
\begingroup\parskip=\medskipamount
\def\endmode{\par\endgroup}}
Please pay attention mainly to the \vbox\bgroup
in \getaddress
and to the \egroup
in \endmode
that gets called by \beginparmode
via \body
. What happens is that \address
starts a \vbox
, which is then ended by the occurence of \body
(or anything else calling \endmode
). The box thus constructed can then be used "both in the letter and in the label on the envelope", as Knuth explains.