Background: Smoking cessation after a diagnosis of type 2 diabetes mellitus (T2DM) lowers cardiovascular risk, but sustained abstinence is difficult and e-cigarettes are promoted as an alternative. Whether switching to e-cigarettes confers comparable benefit is unknown.Methods: This nationwide cohort study used the Korean National Health Insurance Service database. Adults aged 40–74 years newly diagnosed with T2DM between Jan 1, 2018, and Dec 31, 2023, who smoked at the examination preceding diagnosis were included. Self-reported behaviour at the first examination after diagnosis (the index date) defined three groups: quitters, e-cigarette users, and continued combustible cigarette users. The primary outcome was myocardial infarction. Hazard ratios were estimated with Cox proportional hazards models weighted by stabilised inverse probability of treatment weights (IPTW). This study is registered with ClinicalTrials.gov, NCT07414355.Findings: Of 164,859 participants, 31,539 were quitters, 36,801 were e-cigarette users, and 96,519 continued smoking. Over a median 2·1 years (IQR:1·1–3·4), myocardial infarction occurred at 0·8, 1·4, and 1·7 events per 1000 person-years, respectively. Compared with quitters, risk was higher in e-cigarette users (IPTW-adjusted HR:1·78, 95%CI:1·21–2·62) and in continued smokers (HR:2·17, 95%CI:1·66–2·83); risk in e-cigarette users did not differ from that in continued smokers (HR:0·82, 95%CI:0·61–1·12). The pattern was similar for coronary revascularisation (HR:1·26, 95%CI:1·00–1·60 for e-cigarette users and HR:1·23, 95%CI:1·07–1·42 for continued smokers, respectively). Continued smokers also had higher risks of ischaemic stroke (HR:1·20, 95%CI:1·03–1·39) and all-cause death (HR:1·49, 95%CI:1·28–1·73), whereas estimates for e-cigarette users were 0·98 (95%CI:0·72–1·33) and 1·04 (95%CI:0·77–1·42). Dual users, who comprised 24,987 (67·9%) of e-cigarette users, had a higher myocardial infarction risk than complete switchers (HR:2·03, 95%CI:1·17–3·53).Interpretation: Among adults with newly diagnosed T2DM who smoked, cessation was associated with the lowest risk of coronary events, and switching to e-cigarettes did not reproduce this benefit. Risks of stroke and death in e-cigarette users did not differ from those in quitters, but follow-up was short. E-cigarettes should not be regarded as equivalent to cessation after a diagnosis of T2DM.