No - you are right, but may not be considering that the price of the stock will drop approximately by the amount of the dividend on the ex-dividend date.
(eg a 100p share which pays 2p per share dividend, would drop to 98p, all other things remaining the same)
ETA - beaten to it.