I have spoken about this before, in different contexts.
Fr. Z speaks of it here in the context of the question whether one may attend the civil wedding of a Catholic.
An excellent post that I hope will not be disparaged by those who insist that every problem be solved with hard and fast rules.
Read and learn.