Ham — like all deli meats — should be heated to 165°F (74°C) before eating during pregnancy. Cold ham straight from the package or deli counter carries Listeria risk. Heated until steaming, it is considered safe per FDA and ACOG guidelines.
This applies to all forms: sliced deli ham, pre-packaged ham, holiday ham leftovers, and ham in prepared dishes. The rule is temperature, not type.