#1
|
|||
|
|||
Get relative Path to toto.exe
Hello, I have toto.exe under C:\ProgramFiles\...\ Is there a way to search for this executable path ? BR, Vincent |
#2
|
||||
|
||||
Since the path will be absolute, not relative, you need to work with that. Searching all the subfolders under C:\ProgramFiles\ for toto.exe is possible, but will slow down your code's execution every time you run it and really shouldn't be necessary.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Hi,
For my computer it is absolute... but i need relative path to share my program. The only way to find toto.Exe is to search recursively from a parent folder the executable ? Is it possible to do this recursive search for the first execution and store the new path executable path into a global variable... (dunno if it exists in vba...) BR, Vincent |
#4
|
||||
|
||||
Yes, it's possible to do a recursive search and store the path but there is no built-in VBA 'recursive search' function - it would have to be written - and, unless you store the path in a file somewhere, the found path would only be available to the current session.
Since neither of your threads have said anything about what you're trying to achieve, this is all like trying to find a black cat in a warehouse at night (and no torch).
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
My goal is to execute a macro in a Word Document which execute toto.exe with argument "DocumentPath".
Store the absolute path in a .ini file seems to be a good solution. Do you have example about how to do a recursive file search ? |
#6
|
||||
|
||||
See, for example: https://www.msofficeforums.com/word-...html#post47785
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
Thanks a lot
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Relative path between two word documents and text | KenZu | Word | 2 | 10-16-2013 03:23 PM |
Relative path to a video file | dedine | PowerPoint | 3 | 01-31-2013 12:55 PM |
Relative path for video link? Is it possible? | Baudisson | PowerPoint | 1 | 01-10-2012 02:19 AM |
Relative path to desktop | b0x4it | Word VBA | 4 | 05-18-2011 11:50 PM |
attaching (relative,logical or virtual) path to template word document | wissam | Mail Merge | 0 | 08-04-2009 05:09 AM |