A theorem on equidistant codes

It is shown that a nontrivial code consisting of k^2+k+2 words at mutual distance 2k (k > 1) exists if and only if there exists a projective plane of order k.