Swiss climate scenarios predict increases in the frequency and intensity of extreme heat episodes in the future. For the effective prevention of heat-related mortality, several aspects of the population's vulnerability to heat must be understood on a local level. A nationwide analysis of individual death records was conducted, enabling a more comprehensive understanding than typical heat studies based on aggregated data. A total of 320,306 individual death records from the Swiss National Cohort with precise address information during the warm season (May to September) from 2003-2016 were linked to indoor and outdoor high-resolution daily temperature estimates. A time-stratified case-crossover study combined with distributed lag non-linear models was then performed to assess the temperature-mortality associations for various causes of death and to estimate the potential effect modification of individual characteristics. Additionally, it was explored whether the effect of extreme heat changed over time in regions with and without cantonal heat-health action plans (HHAPs). Using the temperature with the lowest cause-specific mortality risk (minimum mortality temperature) as the reference temperature, extreme heat (defined as ambient daily maximum temperature reaching 33 °C) was associated with a strong increase in all-cause mortality (odds ratio (OR): 1.21, 95% CI: 1.17-1.25) and disease-specific mortality from Alzheimer's disease and dementia (OR: 1.67, 95% CI: 1.48-1.88), COPD (OR: 1.37, 95% CI: 1.12-1.67), diabetes (OR: 1.34, 95% CI: 1.06-1.70), and myocardial infarction (OR: 1.26, 95% CI: 1.10-1.44). Indoor temperatures above 24 °C were found to be critical for mortality. The population most vulnerable to heat included older adults (≥75 years), unmarried individuals, people with a low education level, older women with low neighbourhood socioeconomic position, and men under 75 years old with low socioeconomic position. Overall, the risk of heat-related all-cause mortality in 2009-2016 was lower than that in 2003-2008. The decrease was significantly stronger in the region where cantonal HHAPs were implemented. This study provides important information for planning targeted and effective measures to reduce heat-related health risks in Switzerland. It demonstrates that HHAPs contribute to reducing heat-related mortality, although they may not reach the high-risk population of individuals with low socioeconomic position. Future prevention efforts should also target the less privileged population, including people younger than 75 years.