You need to establish if the wood worm is active. Is it an old piece of skirting board? Active woodworm usually shows very fine dust around the flight holes where the littles blighters have eaten their way in. If it is a localised outbreak, you can buy preservative treatment at any good diy supplier and apply it yourself with a brush. Most of these chemical treatments work by coating the timber while the worm larvaeare inside the holes. As they try to eat their way out, they are poisoned by the chemical. The chemical itself will not repair the holes - thats why previously infected timber may be perfectly safe if an earlier outbreak has already been eradicated. Unlike with other more serious problems like dry rot, only the actual timbers showing signs of activity need to be treated, but most specialists will treat an entire attic area for example as a precaution against spread. Timbers only need to be replaced if the worm damage is so severe as to affect its structural integrity. Check around the timbers lying behind the skirting, such as wall lining straps, floorboards and joists to see if they are affected. Hope this helps