We demonstrate that a transmission electron microscope fitted with two spherical-aberration correctors can be operated as an energy-filtered scanning confocal electron microscope. A method for establishing this mode is described and initial results showing 3D chemical mapping with nanoscale sensitivity to height and thickness changes in a carbon film are presented. Importantly, uncorrected chromatic aberration does not limit the depth resolution of this technique and moreover performs an energy-filtering role, which is explained in terms of a combined depth and energy-loss response function.