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

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_ROOTWord.Document.8shellOpen key.
  2. Rename the ddeexec sub-key to ddeexec.disabled.
  3. Navigate to the HKEY_CLASSES_ROOTWord.Document.8shellOpencommand 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_ROOTWord.Document.12shellOpen key.
  2. Rename the ddeexec sub-key to ddeexec.disabled.
  3. Navigate to the HKEY_CLASSES_ROOTWord.Document.12shellOpencommand 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.