Finding a File


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Finding a File

  1. #1
    Tony Ritcherson Guest

    Finding a File


    I've written a program that shells to Microsoft Word...
    On my computer the path is "c:\program files\microsoft office\office\winword.exe"
    But if i send this program to another computer, winword.exe may be in a different
    directory... and so my program wouldn't work... because winword.exe would
    be in the wrong place...hehehe
    So i thought that if i could search the harddrive for winword.exe.... and
    then find the path to it...i could write my program in such a way that it
    could take path variations into account...
    How do i write a procedure therefore that will search to see if winword.exe
    exits, and then if it does...what is the path to it...
    If you can help me i really appreciate it....

  2. #2
    Damit Senanayake Guest

    Re: Finding a File

    Tony,

    : How do i write a procedure therefore that will search to see if
    winword.exe
    : exits, and then if it does...what is the path to it...

    Instead of doing this, you can use either:

    (a) ShellExecute with a document name to launch Word and open the document

    or

    (b) FindExecutable on an existing Word document (doesn't have to have
    anything in it)

    Personally, I would go with (a), particularly if you're opening documents.

    --
    Damit Senanayake | damit@mvps.org
    Please reply to newsgroups, not by e-mail.
    http://members.xoom.com/damit | {http,ftp}://damit.dyndns.org (experimental)
    ICQ: 6930718





  3. #3
    Damit Senanayake Guest

    Re: Finding a File

    Tony,

    : How do i write a procedure therefore that will search to see if
    winword.exe
    : exits, and then if it does...what is the path to it...

    Instead of doing this, you can use either:

    (a) ShellExecute with a document name to launch Word and open the document

    or

    (b) FindExecutable on an existing Word document (doesn't have to have
    anything in it)

    Personally, I would go with (a), particularly if you're opening documents.

    --
    Damit Senanayake | damit@mvps.org
    Please reply to newsgroups, not by e-mail.
    http://members.xoom.com/damit | {http,ftp}://damit.dyndns.org (experimental)
    ICQ: 6930718





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center