The work, W, done by a constant force, F, which acts on a body during a displacement, d, is given by

            W = F·d = F*d*cos(q)

where q is the angle between F and d.

This implies that there must be a component of the force in the direction of the displacement for work to be done.
Note that work is a scalar, F and d are vectors with magnitudes F and d.