Stop MacOS X Lion Office reopening old documents

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.

System Preferences

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
This entry was posted in Mac. Bookmark the permalink.

3 Responses to Stop MacOS X Lion Office reopening old documents

  1. Jim Greer says:

    Thanks! This was driving me nuts.

  2. Christopher says:

    OMFG, YEESSS!!!!!!!!! Thank-you, you have no idea..

  3. 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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s