Results 1 to 3 of 3

Thread: Path

  1. #1
    Join Date
    Sep 2005
    Posts
    313

    Unanswered: Path

    Hi,

    Ans1:
    MyShortcut.TargetPath = "C:\Program Files\Microsoft Office\Office10\Msaccess.exe "

    Ans2:
    MyShortcut.TargetPath = "C:\Program Files\..\Msaccess.exe "

    The Ans1 works fine.
    The Ans2 doesn't work.

    I want to work the Ans2, because every user machine's Office path is different.

    For example:
    MyShortcut.TargetPath = "C:\Program Files\Microsoft Office\Office10\Msaccess.exe "

    MyShortcut.TargetPath = "C:\Program Files\Microsoft Office\Office11\Msaccess.exe "

    MyShortcut.TargetPath = "C:\Program Files\Microsoft Office\Office12\Msaccess.exe "

    MyShortcut.TargetPath = "C:\Program Files\Microsoft Office\Office13\Msaccess.exe "

    So, I want to create the link with the target
    MyShortcut.TargetPath = "C:\Program Files\...\Msaccess.exe "

    How can I do it?
    Please let me know, thanks.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    have a look at the environ function - it will return a whole host of information, including the path of of the office install.

    I think there may even be a fucntion with Access itself to find this, but I can't remember, I think someone recently contributed this in this forum - try the search.

    a word of caution you cannot rely on the numerical index of the environ parameter you require to be consistent accross computers. Also you shouldn't rely on environ for security related information. its too easily faked
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    What do you need this for?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •