Medium-range order and quasicrystal formation in Zr57Cu20Al10Ni8Ti5 and Zr59Cu20Al10Ni8Ti3 metallic glasses are investigated by means of nuclear magnetic resonance (NMR). The samples are prepared by rapid solidification and annealed to induce primary quasicrystal formation. 27Al and 63Cu NMR spectra and spin relaxation curves are recorded before and after the annealing process. The spectral width of 27Al and 63Cu NMR spectra is relatively small and can be taken as a proof for the presence of medium-range order in these metallic glasses. By simulations of 27Al and 63Cu NMR second moments in various binary Al and Cu compounds the medium-range orders L12 AlZr3 and C11b CuZr2 can be identified in both as-quenched metallic glasses. After heat treatment both metallic glasses show considerable changes in the 63Cu NMR second moments, whereas the 27Al NMR second moments show only relatively small changes. Furthermore, the 63Cu NMR second moment after heat treatment in Zr57Cu20Al10Ni8Ti5 is about half as large as in Zr59Cu20Al10Ni8Ti3 indicating different types of crystallization during heat treatment.