View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Find Executable Path with Excel

This example from Randy Birch should do it
http://vbnet.mvps.org/index.html?cod...executable.htm

in the example change -
success = FindExecutable("winhlp32.hlp", "c:\winnt\system32\", sResult)

to -

Dim sFile$ ' place up top
sFile = "c:\my documents\myDoc.doc"
success = FindExecutable(sFile, "", sResult)

Regards,
Peter T


"Brandt" wrote in message
...
Hello All!

Does anyone know of a way to find the path to the executable that opens a
particular file, such that if I give the path to a file (or just the file
type extension) it will return the path to the executable that opens that
file. For example if I give the path to "C:\Documents and
Settings\brandt\Desktop\mywordfile.doc" it will return the path to

winword.exe

Thanks in advance for your help

Brandt