The Mid() calculation is off... consider:
1234567890 ..say your link is 345. LinkStart=Instr(345)=3. LinkEnd=5.
Mid(text, 3+1, 2) would only return 45

I'd also look at the routines providing the LinkStart/LinkEnd values too.