You're making things much worse by punishing her. The problem is this...she has not been taught how to meet and greet people. Most people have their dogs sit politely for petting and the greeting...basically, laying down the rules of how the dog is supposed to say Hi to people. If you let the dog make up their own rules, they're not really going to know how to act.
And, yes, part of this is for the attention as dogs are highly social but, that doesn't always mean they are well mannered or have all the good social graces...that's where your training comes in.
And, yes, part of this is for the attention as dogs are highly social but, that doesn't always mean they are well mannered or have all the good social graces...that's where your training comes in.