Excel - yes. I've been working on reporting and needed a workaround for Excel's ugly CSV interpretation. This MIGHT help you out if you're working with Excel:
http://support.microsoft.com/default.aspx?scid=kb;en-us;260239&Product=xlw
Watch out - the code is ASP. But you'll find PHP's header() will work in place of "Response.ContentType".
Check out the MIME types for Word. I think just "application/word" will work. Then send text to the browser. But because you've changed the MIME type, the browser should launch Word. Now if you're doing this all from IE, then IE will probably load Word/Excel from within IE. Check it out in another browser and you'll see it loads the Office apps outside the browser.
If you wish to force the file to be downloaded, check out application/octet-stream as the MIME type.