Formal cooperation with a grave sin is itself a grave sin. However, the Canon that gives the penalty of automatic excommunication for procuring a completed direct abortion does not extend to formal cooperation with abortion.
However, the Canon giving the penalty of automatic excommunication for formal heresy would apply to any Catholic who knowingly rejects the teaching of the Church that direct abortion is always gravely immoral.