Just because there are so many who do not know about this (absolutely binding) rule in the Church, it bears stating here for the sake of clarity.
Canon 915: Those who have been excommunicated or interdicted after the imposition or declaration of the penalty and others obstinately persevering in manifest grave sin are not to be admitted to holy communion.
This is the general rule that applies to any and all Catholics. A brief explanation would be as follows: if someone has been told by the Church that they cannot receive Holy Communion, then it means that he or she cannot receive Holy Communion. Also, if someone refuses to repent of a grave sin after the sin has been made clear to them, then he or she is not even supposed to attempt to receive Holy Communion. To fail to abide by this law adds another grave sin on top of the previous grave sin.
To put it in overly basic terms: "You cannot receive Holy Communion if all you did was say 'oops' after committing a grave sin".