When you are expecting, everyone has advice and for some reason feels that they can share it freely.
"Get the epidural, you don't have to be a hero"
"Put the baby down, you'll spoil him"
"Go ahead, you're eating for two"
"Rub your nipples now, it will prepare them for nursing"
"You must use your great-aunt Myrtle's name"
.... everyone who has been pregnant has heard some advise like this.
I have heard my share. I really try to keep my mouth shut unless I am asked specifically. But my favorite piece of advice, I believe it applies to every, any, and all parents, I will give unsolicited. That is: To parent from the heart no matter what. Listen to your parenting instincts and they won't steer you wrong.
As for what to say to people who are going on and on with their advise? Keep in mind advise usually comes coated with love, concern, and the need to help, most often it is given with the best intentions. Obviously depending on the subject and giver of the advise your response has to be different but for most a smile and 'thank you' work well. If not, I always reverted to the pediatrician, "I'll check with the doctor." No one wants to contradict the doctor.
And certainly don't expected the unsolicited advise to stop once the baby arrives.. there will be a whole new set of opinions headed your way.