In order to exploit X-ray powder spectro-diffractometry, the program RIETAN-97ß for refining crystal structure and lattice parameters by the Rietveld method was modified extensively. The resulting software can be used to refine anomalous scattering factors, fr and fi, for specified crystallographic sites near the X-ray absorption edge of a particular element. The effectiveness of the modified software was tested by using powder diffraction patterns simulated by the original RIETAN-97ß software and a series of measured powder diffraction patterns of Fe3O4 with incident X-ray energies near the absorption edge of iron.