The mass and width of the W boson are measured using e+e- -> WW events from the data sample collected by the OPAL experiment at LEP at centre-of-mass energies between 170 GeV and 209 GeV. The mass (mW) and width (gammaW) are determined using direct reconstruction of the kinematics of WW -> qqlnu and WW -> qqqq events. When combined with previous OPAL measurements using WW -> lnulnu events and the dependence on mW of the WW production cross-section at threshold, the results are determined to be
       mW = 80.415 +- 0.042 +- 0.030 +- 0.009 GeV
   gammaW =  1.996 +- 0.096 +- 0.102 +- 0.003 GeV
where the first error is statistical, the second systematic and the third due to uncertainties in the value of the LEP beam energy. By measuring mW in the qqqq channel using several different determinations of the direction of jets with differing sensitivities to soft particles, a limit is also obtained on possible final-state interactions due to colour reconnection effects in WW -> qqqq events. The consistency of the results for the W mass and width with those inferred from other electroweak parameters provides an important test of the Standard Model of electroweak interactions.