Whenever a force is applied to an object, causing the object to move, work is done by the force. If you move the book at constant speed horizontally, you don't do any work on it, despite the fact that you have to exert an upward force to counter-act gravity.