UPDATE: This doesn’t seem to work any more. I now just have the setting “Close windows when quitting an application” set in System Preferences – General.
Original post:
On Mac OS X Lion, Microsoft Word reopens previously edited documents when you start it up. This can be very annoying.
To stop it, run this:
defaults write com.microsoft.Word NSQuitAlwaysKeepsWindows -bool false
You can substitute different applications for com.microsoft.Word. You can find the names in ~/Library/Saved Application State.
If you want to fix all the main Office apps (and Preview) in one go, run this script:
#!/bin/bash
function runit
{
defaults write $1 NSQuitAlwaysKeepsWindows -bool false
}
runit com.microsoft.Word
runit com.microsoft.Excel
runit com.microsoft.Powerpoint
runit com.apple.Preview

Thanks! This was driving me nuts.
OMFG, YEESSS!!!!!!!!! Thank-you, you have no idea..
thanks, that’s brilliant. That issue has been driving me crazy until now. Thanks for taking the time to write the code, as that would have taken me a long time to work out.