If some portion of the dividend is used for something other than purchasing stock, then it is not a part of your basis.So if you got a dividend of $100 and the entire dividend was reinvested, it does not matter that you had to use some other money to pay perhaps $25 of tax on the dividend.