Get Application Path for Office Document

S

solun

I'm trying to determine the path to the office executable for a document
(e.g. "C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE" to open a MS
Access database). Does anyone know the most reliable way to do this with VBA?

I want to write a method that will work with any version of the program
(Office 97, 2000, XP, etc.).

I'm guessing I need to read the registry, unless there is an object I can
reference.
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?c29sdW4=?=,
I'm trying to determine the path to the office executable for a document
(e.g. "C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE" to open a MS
Access database). Does anyone know the most reliable way to do this with VBA?

I want to write a method that will work with any version of the program
(Office 97, 2000, XP, etc.).

I'm guessing I need to read the registry, unless there is an object I can
reference.
Yes, this has been answered/posted in the Office.developer newsgroups at least
four times in the past month...

You can search the Registry for an entry such as Word.Application in the HKCR
section. From that, you get the CLSID. Then you search the CLSID in the same
section. One of the values under that gives you the application path.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top