Taming Microsoft Word 2007’s File Associations and Document Windows, Part Two

committed to database on September 3, 2008 at 10:10 pm Eastern Standard Time 7 comments digg this

Sunday, I blogged about how I had dinner with Paul Thurrott and one of the topics on the table was how Microsoft Word affects window z-order. If you haven’t read it, I suggest you do… otherwise you’ll be lost.

Due to the way Word was designed, there doesn’t appear to be an easy solution to preserve the use of the DDE command and keep window z-order intact (on our end). In Connect lingo, this would have probably been marked WILLNOTFIX. Thankfully, we can tweak the registry a bit to alter the open behavior, therefore making Paul Thurrott happy.

Here is some very important information I’m required to inform you about:

  • Each document opened will now spawn a new winword.exe process.
  • Changing behavior for other actions (e.g. print) is out of this guide’s scope
  • Changing behavior for other applications (e.g. Powerpoint, Excel) is out of this guide’s scope.
  • Backing up the registry, undoing the changes, or other otherwise covering your ass is out of this guide’s scope.

Okay, let’s dig in! First, let’s brush up on some registry terminology with a cleverly produced picture.

That committed to non-pageable memory, let’s continue by altering the open behavior for legacy documents (.doc files)…

  1. With an elevated registry editor, navigate to HKEY_CLASSES_ROOT\Word.Document.8\shell\Open key.
  2. Rename the ddeexec sub-key to ddeexec.disabled.
  3. Navigate to the HKEY_CLASSES_ROOT\Word.Document.8\shell\Open\command key and rename the command value to command.disabled. Do not confuse the command value with the command key!
  4. Double-click the (Default) value and append "%1" (including quotes) to the end of the data string.
  5. Verify that legacy documents open in a new process upon every invocation.

… and now lets alter the open behavior for new documents (.docx files) …

  1. With an elevated registry editor, navigate to HKEY_CLASSES_ROOT\Word.Document.12\shell\Open key.
  2. Rename the ddeexec sub-key to ddeexec.disabled.
  3. Navigate to the HKEY_CLASSES_ROOT\Word.Document.12\shell\Open\command key and rename the command value to command.disabled. Do not confuse the command value with the command key!
  4. Double-click the (Default) value and append "%1" (including quotes) to the end of the data string.
  5. Verify that new documents open in a new process upon every invocation.

Okay, what did we just do? We simply disabled the DDE-related keys (just in case you need to restore them) and altered the launch command to include the document, you double-click, as a command line parameter, since the DDE FileOpen command will no longer be sent. Easy!

For those looking to automate this process, say for an entire enterprise-wide deployment, cough, you can use my PowerShell script. Just paste it into the PowerShell window and pray you don’t see red.

  1. surilamin September 4, 2008 at 11:49 am

    MS should really hire you…

  2. desu September 9, 2008 at 10:28 pm

    man that was annoying, and the video speed didn’t help.

  3. Scott October 9, 2008 at 2:13 pm

    You have just saved me from so much annoyance!

  4. Zach March 30, 2009 at 10:49 pm

    Thanks, looking for this solution for a long time now……So much for Micro$oft doing anything about it.

  5. You da bomb April 8, 2009 at 5:58 pm

    I have wanted to do this for such a long time…