none
Path to WinWord.exe RRS feed

  • Question

  • Hi All

    I need the path to Word 2013 to engage the app into a DDE communication. When I lookup the path in the registry I can find the value here: {HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Word\Options\PROGRAMDIR}

    On another machine the user had Office 2010 installed and made an upgrade to Office 2013. The value in {HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Word\Options\PROGRAMDIR} is the same. But in the WinWord.exe is located in a different path (C:\Program Files (x86)\Office2010\Office15\).

    Is there another more reliable way to determine the location of the WinWord.exe file?

    Thanks for any help.

    Martin

    Friday, November 15, 2013 5:33 PM

Answers

  • Try looking up Word.Application in the HKEY_Classes_Root. Get its CLSID and look that up in the same section. There you should be able to read the LocalServer/Default value to get the path to the exe.

    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Martin Koenig Saturday, November 16, 2013 5:57 PM
    Friday, November 15, 2013 6:50 PM
    Moderator
  • Hi Martin

    What you get when you check Word.Application can vary depending on what the user has installed, in what order. Officially, parallel version installations are not supported, but users do it, which can make things difficult - as you're seeing.

    If you look in the Registry you should see that, besides the generic Word.Application there will be an entry for each version that is or has been installed, such as Word.Application.15. If you want to target a specific version, you can try searching for that. But Word will tend to point everything to the same winword.exe file for all versions. So it can depend on which version the user last ran.

    The only other possiblity would be to search the entire system for winword.exe and then try to read the version information, but I don't have any code for that.


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Martin Koenig Wednesday, March 23, 2016 9:12 AM
    Tuesday, November 19, 2013 4:11 PM
    Moderator

All replies

  • Try looking up Word.Application in the HKEY_Classes_Root. Get its CLSID and look that up in the same section. There you should be able to read the LocalServer/Default value to get the path to the exe.

    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Martin Koenig Saturday, November 16, 2013 5:57 PM
    Friday, November 15, 2013 6:50 PM
    Moderator
  • Hi Cindy

    Thanks for your tip. When I look up the CLSID in the HKEY_Classes_Root and then look up the LocalServer/Default value I cant determine the path to Word 15. I get the path to Word 9 - which is installed on the machine to and will be replaced by Word 15.

    In seldom circumstances I do not get the path to Word 15. I guess it has to do how Office has been installed on the machine.

    Thanks for your help anyway.

    Martin

    Saturday, November 16, 2013 5:57 PM
  • Hi Martin

    What you get when you check Word.Application can vary depending on what the user has installed, in what order. Officially, parallel version installations are not supported, but users do it, which can make things difficult - as you're seeing.

    If you look in the Registry you should see that, besides the generic Word.Application there will be an entry for each version that is or has been installed, such as Word.Application.15. If you want to target a specific version, you can try searching for that. But Word will tend to point everything to the same winword.exe file for all versions. So it can depend on which version the user last ran.

    The only other possiblity would be to search the entire system for winword.exe and then try to read the version information, but I don't have any code for that.


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Martin Koenig Wednesday, March 23, 2016 9:12 AM
    Tuesday, November 19, 2013 4:11 PM
    Moderator
  • Surface Laptop with Office365 preinstalled.

    I am trying to programmatically determine file location of 'winword.exe' using registry entries. It's in none of the above locations, or any of the other locations that appear on other boards. I am at a total dead-end.

    Any help on where the winword.exe path is stored in the registry would be greatly appreciated. (I actually know where winword.exe is on my computer, but when I search for that path in the registry to try to back into a solution, I get zilch.)

    Roy


    • Edited by Roy1953 Tuesday, October 10, 2017 10:22 AM
    Tuesday, October 10, 2017 10:21 AM
  • MsgBox Application.Path

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Tuesday, October 10, 2017 10:49 AM
  • Actually, I know where it is on this particular computer. I want to find it programatically using Registry references so that I can write an installer program to place an Add-in on 'John Doe's computer'. Thanks for getting back.
    Tuesday, October 10, 2017 11:26 AM
  • Well, it sounds as if you've searched everywhere, so maybe there is another problem. But I think what has changed since Cindy's posts a few years ago is that 64-bit Windows (and Office) are much more widespread. Here, for example, I looked in HKEY_CLASSES_ROOT (HKCR) for Word.Application (actually Word.Application.16) and got the CLSID {000209FF-0000-0000-C000-000000000046}, but the HKCR\CLSID\{000209FF-0000-0000-C000-000000000046} key did not contain a "LocalServer" key of any kind, just an InprocServer and/or InprocHandler key. 

    Here, (64-bit Windows, 32-bit Office) I found the LocalServer32 key in the WOW6432Node branch, i.e. in HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{000209FF-0000-0000-C000-000000000046}\LocalServer32

     I suppose someone with 64-bit Office might have a different key (perhaps in the original location, perhaps named LocalServer64 - I don't know). But anyway, it looks as if the number of places to look has expanded again.


    Peter Jamieson

    Friday, October 13, 2017 3:55 PM
  • You can check this registry path:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe

    Friday, November 2, 2018 12:41 PM