When someone is excommunicated, it is my understanding that they are not permitted to partake of the sacraments, but does it also mean that they will not go to heaven if the excommunication is not lifted?
Excommunication is what is called a medicinal penalty. Medicinal penalties have the primary purpose of calling a person to repentance. Excommunication cuts a person off from the sacraments in an attempt to shake them awake from their sins.
Excommunication, in and of itself, does not send someone to hell. Whatever sin the person committed that led to the excommunication most likely would result in hell if the person was truly culpable and died unrepentant.
Excommunication is analogous to a family that kicks their drug abusing child out of their home. The parents are using “tough love” in an attempt to save their child, they’re not trying to hurt their child. In a similar manner, the Church excommunicates someone in order to help bring them back to the right path.