...although the principal effect of a sacrament can be had without actually receiving that sacrament, either without the sacrament or derivatively through another sacrament, nonetheless it cannot ever be had without the intention for that sacrament. And so, because penance is principally instituted against actual fault, whatever other sacrament may remove fault derivatively, it does not remove the need for penance.
[St. Thomas Aquinas, Super Sent 4 d23 q1 a2 qc1 ad 1, my translation. See also Summa Theologiae Supp.30.1ad1, which just takes this passage over directly. Aquinas is explaining why it is that, even though extreme unction remits sins, one should nevertheless also have confession with it whenever possible.]