Objectives Undergraduate medical teaching in occupational health (OH) is a challenge in universities around the world. Case-based e-learning with an attractive clinical context could improve the attitude of medical students towards OH. The study question is whether case-based e-learning for medical students is more effective in improving knowledge, satisfaction and a positive attitude towards OH than non-case-based textbook learning. Methods Participants, 141 second year medical students, were randomised to either case-based e-learning or text-based learning. Outcome measures were knowledge, satisfaction and attitude towards OH, measured at baseline, directly after the intervention, after 1 week and at 3-month follow-up. Results Of the 141 participants, 130 (92%) completed the questionnaires at short-term follow-up and 41 (29%) at 3-month follow-up. At short-term follow-up, intervention and control groups did not show a significant difference in knowledge nor satisfaction but attitude towards OH was significantly more negative in the intervention group (F¼4.041, p¼0.047). At 3-month follow-up, there were no significant differences between intervention and control groups for knowledge, satisfaction and attitude. Conclusions We found a significant decrease in favourable attitude during the internship in the experimental group compared with the control group. There were no significant differences in knowledge or satisfaction between case-based e-learning and textbased learning. The attitude towards OH should be further investigated as an outcome of educational programmes.