The ABA has a formal opinion on this topic and an opinion on threatening criminal charges.