A measurement of the forward-backward asymmetries for bbbar and ccbar production in e+e- annihilation is presented. The data were collected using the OPAL detector at LEP at center-of-mass energies between 130 GeV and 209 GeV. Two methods are used to identify events containing b or c quarks and to determine the production angle of the primary quarks. One utilizes a powerful b-tagging algorithm based on lifetime, leptons and event-shape information, combined with the hemisphere charge. The other uses information from leptons in semileptonic decays of heavy hadrons. The two methods are combined using a single likelihood function to determine the b and c asymmetries simultaneously by fitting the observed angular distributions. Results obtained at 11 center-of-mass energies are in good agreement with the Standard Model predictions.