Observations of giant stars indicate that the frequency of giant planets is much higher for intermediate-mass stars than for solar-like stars. Up to now all known planets of giant stars orbit at relatively far distances from their host stars. It is not known whether intermediate-mass stars also had many close-in planets when they were on the main sequence, which were then engulfed when the star became a giant star. To understand the formation and evolution of planets it is therefore important to find out whether main-sequence stars of intermediate-mass have close-in planets or not. A survey for transiting planets of intermediate-mass stars would be ideal to solve this question, because the detection of transiting planets is not affected by the rapid rotation of these stars. As a first step for an efficient survey we need to identify intermediate-mass stars in the CoRoT-fields, which can then be used as an input list. To compile the input list we derived the spectral types of essentially all O, B and A stars down to 14.5 mag in the CoRoT fields IRa01, LRa01, LRa02 taken with the multi-object spectrograph AAOmega. We determined the spectral types by comparing the spectra with template spectra from a library. In total we identify 1856 A and B stars that have been observed with CoRoT. Given the number of planets that have been detected in these fields amongst late-type stars, we estimate that there are one to four transiting planets of intermediate-mass stars waiting to be discovered. Our survey not only allows us to carry out a dedicated planet search programme but is also essential for any types of studies of the light curves of early-type stars in the CoRoT database. We also show that it would be possible to extend the survey to all fields that CoRoT has observed using photometrically determined spectral types.