We present model calculations to investigate the isotopic behavior of both heavy carbon dioxide molecules (COO)-O-17-O-16 and (COO)-O-18-O-16 in the stratosphere and mesosphere. For this purpose the existing theory of O-18 transfer between O-3 and CO2 via O(D-1) and the electronically excited complex CO*(3), as proposed by Yung et al. [1991], is extended to O-17. Our one-dimensional model agrees well with atmospheric measurements performed till now, when reasonable assumptions for the isotopic composition of ozone in the middle atmosphere are made, and when in addition a mass-dependent fractionation process during the transfer of oxygen atoms is included. Best agreement between model results and atmospheric CO2 isotope data is obtained by assuming (1) an averaged O-3 isotope composition in the middle atmosphere of delta(17)O = (12.5+/-1.5)% and delta(18)O = (16+/-1.5)% (versus Vienna standard mean ocean water) and (2) a mass-dependent isotope fractionation during the O atom transfer via CO*(3) of (32+/-7)%parts per thousand for O-17 and (64+/-14)parts per thousand for O-18, both relative to O-16. Effects of CO2 photolysis and its reformation via the reaction CO + OH --> CO2 + H on the CO2 isotope composition are found to be small and may be neglected.