This behavior is not going to go away with a shock collar.
Many dogs just develop a tolerance to the shock and just keep going.
The difference between using a shock collar for barking and one for the invisible fence is the fact that the invisible fence initiates that low tone that gives them that warning first. My own opinion is that shock collars are more painful physically and emotionally than a very simple debarking. Most vets go in through the mouth, snipping a piece of the vocal cord. They still continue to bark as they always did, it's just a whisper. Now if this was a young dog that was just beginning to develop this habit, then I would say yes, try some other methods first.