In macromolecular electronics the organic material should offer—besides the desired electronic properties—the possibility of lateral patterning. Here, we report on a novel polyaniline derivative bearing photosensitive N-formamide groups. UV illumination of this polymeric material leads to a decarbonylation reaction resulting in polyaniline which can be subsequently protonated to yield the conductive emeraldine salt. Due to the fact that the conductivity depends on the conversion of the photoreaction, a selective adjustment of the conductivity by means of UV light is feasible. These photo-induced conductivity changes were corroborated in thin films by conductive AFM measurements. Further, we demonstrate the versatility of this polymer with respect to a patterned modification of the conductivity as well as its application as a photo-patternable charge injection layer for structured OLEDs. This makes the new polymer an interesting candidate for electrodes and interconnects in various organic electronic devices.