Strong effects of the magnetic anisotropy on the exchange coupling are observed in FM1/NiO(6 nm)/FM2 trilayers with ferromagnetic (FM) layers Co or Fe. Different magnetic properties are found for Co/NiO/Fe and Fe/NiO/Co trilayers with Ag sublayer and cover layer. The Ag sublayer strongly affects the magnetic anisotropy of FM/antiferromagnetic (FM/AF) bilayers and further influences the exchange coupling in FM1/NiO/FM2 trilayers. In particular, the sign of the magnetoresistance changes from negative after zero-field cooling to positive after field cooling, which is due to a reversal of the Co spin polarization. Furthermore, the interfacial coupling between FM and NiO enhances the blocking temperature of NiO.