S.W.
My suggestion is to say, "Ow! That hurts", or something to that effect. Then put her down for a minute (sort of like a time out, but you're still engaged with her, not ignoring her!). Then pick her up again. If she does it again, repeat. Continue with this cycle until she gets it that she shouldn't do that, otherwise she won't get held. She'll get the idea eventually.
S. Wolf
Licensed Marriage & Family Therapist