I can't comment specifically on the foam part, because we did not worry about it -- all our foam is at least 1 foot off the ground, ending at the stone covered, concrete grade beam.
For all the wood -- door frames/bucks to 2 feet up, windows bucks (all PT wood), thresholds, porch beams, porch header attached to grade beam, etc. etc., I sprayed (twice) with Bora-Care at framing stage. It's a gel-based product that you mix with water and use a pump-sprayer with. It is absorbed by the wood and becomes "fixed" in the cellular structure of the wood. Anything that ingests it -- termites, wood borers, wood rot fungus -- dies.
See http://www.pestproducts.com/borate.htm