We present a new instrument for contact potential measurements, combining the well-known principle of the Kelvin probe (vibrating capacitor) method with the more recent developments in near-field microscopies. This instrument enables one to measure spatial variations in the electronic work function of a specimen on the submicron scale by a non-destructive technique, with a typical accuracy in the 10 meV range. The high spatial resolution is achieved by means of an electrically guarded electrostatic probe. Developments in the probe manufacturing technique should lead in the near future to a significant improvement in the resolution, down to the 100 nm scale. The instrument has the additional capability of detecting static charges, hence its potential use in various fields of surface physics and technology: investigation of the band curvature at semiconductor surfaces and the measurement of surface trap densities in semiconductor devices; surface diffusion in metals; ferroelectric domain visualisation; study of triboelectricity, among many others.