We study the optical orientation of electron spins in GaAs/AlGaAs quantum wells for excitation in the growth direction and for in-plane excitation. Time-and polarization-resolved photoluminescence excitation measurements show, for resonant excitation of the heavy-hole conduction band transition, a negligible degree of electron spin polarization for in-plane excitation and nearly 100% for excitation in the growth direction. For resonant excitation of the light-hole conduction band transition, the excited electron spin polarization has the same (opposite) direction for in-plane excitation (in the growth direction) as for excitation into the continuum. The experimental results are well explained by an accurate multiband theory of excitonic absorption taking fully into account electron-hole Coulomb correlations and heavy-hole light-hole coupling.