Without loss of generality, we may assume the word looks like this:
$$ \overbrace{11\dots 1}^{\ell}\overbrace{00\dots 0}^{n-\ell}. $$
Assume we change $a$ of the $1$'s and $b$ of the $0$'s. The weight of the new word will be $\ell -a + b = h$. The distance between both words will be $s = a+b$. Under the given assumptions, these equations have a unique solution $(a,b)$ and the answer is then given by $$ \binom{\ell}{a} \binom{n-\ell}{b} $$
Added: The solution is given by $$\begin{align*} a &= \frac{\ell+s-h}{2} \\ b &= \frac{h+s-\ell}{2} \end{align*}$$ We know that $h+\ell-s$ is even, therefore $\ell+s-h$ and $h+s-\ell$ is even as well. (Parity ignores signs.) But the extra conditions that $$ 0 \leq a \leq \ell \text{ and } 0\leq b \leq n-\ell $$ must be met as well. If these conditions are satisfied, the number of such words are indeed given by the formula above; if not then there are no such words.