Materials are said to show a shape-memory effect if they can be deformed and fixed into a temporary shape, and recover their original, permanent shape only on exposure to an external stimulus. Shape-memory polymers have received increasing attention because of their scientific and technological significance. In principle, a thermally induced shape-memory effect can be activated by an increase in temperature (also obtained by heating on exposure to an electrical current or light illumination). Several papers have described light-induced changes in the shape of polymers and gels, such as contraction, bending or volume changes. Here we report that polymers containing cinnamic groups can be deformed and fixed into pre-determined shapes--such as (but not exclusively) elongated films and tubes, arches or spirals--by ultraviolet light illumination. These new shapes are stable for long time periods, even when heated to 50 degrees C, and they can recover their original shape at ambient temperatures when exposed to ultraviolet light of a different wavelength. The ability of polymers to form different pre-determined temporary shapes and subsequently recover their original shape at ambient temperatures by remote light activation could lead to a variety of potential medical and other applications.