The reaction of acryloyl chloride (I) with pentane-1,5-diol (II) by means of triethylamine and pyrogalol in hot benzene gives 1,5-pentamethylene diacrylate (III), which is condensed with tetrahydropapaverine (IV) in refluxing benzene to afford N,N'-4,10-dioxa-3,11-dioxotridecylene-1,13-bis(tetrahydropapaverine) (V). Finally, this compound is quaternized by treatment with methyl benzenesulfonate in acetonitrile.