http://www.koffice.org/download/source.php
May be this can help too: http://developer.kde.org/build/newbie_build_cvs.html
Both documents tell about building KDE too. If you have already KDE just jump on these parts or adapt them to KOffice.
For KOffice 1.2.x, you need KDE 3.0 or 3.1 (KDE CVS HEAD could work too.) For KOffice 1.3 Beta 3, you needed KDE 3.1.
However, for KOffice CVS HEAD and any snapshots of the last days, you need either a very recent KDE 3.1.x (so from the CVS branch KDE_3_1_BRANCH) or KDE CVS HEAD. Otherwise, you will not be able to save any document. (This problem will not be fixed in future, as it fixes a least a bug, if I have understood well.)
Have a nice day!