We study a model of a semiflexible long chain polymer confined to a two-dimensional slit of width $w$, and interacting with the walls of the slit. The interactions with the walls are controlled by Boltzmann weights $a$ and $b$, and the flexibility of the polymer is controlled by another Boltzmann weight $c$. This is a simple model of the steric stabilisation of colloidal dispersions by polymers in solution. We solve the model exactly and compute various quantities in $(a,b,c)$-space, including the free energy and the force exerted by the polymer on the walls of the slit. In some cases these quantities can be computed exactly for all $w$, while for others only asymptotic expressions can be found. Of particular interest is the zero-force surface -- the manifold in $(a,b,c)$-space where the free energy is independent of $w$, and the loss of entropy due to confinement in the slit is exactly balanced by the energy gained from interactions with the walls.