Open file, use relative paths

  • Thread starter Thread starter Doekoe
  • Start date Start date
D

Doekoe

In our Access application we open JPG, PDF en XLS file. I use the
Shell command for this.

RetVal = Shell("C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32 " &
fNamePDF, vbMaximizedFocus)

This works fine however one big issue here. As you can see in the
above example I need to program the whole path. With Adobe I need to
change this path after every update (Reader 9.0), and so I have to
update alle clients to latest version. Now I have the same with
Excel.

RetVal1 = Shell("C:\Program Files\Microsoft Office\OFFICE12\Excel.exe
" & fNameExcel, vbMaximizedFocus)

We have clients using office 2003 (OFFICE11) and Office 2007
(OFFICE12).

Is there a way to avoid the paths and open the documents with the
available Adobe version and Excel version on the clients computer?

Thanks in advance.

Dirk
 
On Mon, 25 May 2009 07:19:38 -0700 (PDT), Doekoe

You can do what Windows does when you double-click a file: it checks
which app is registered to handle that file extension and invokes that
app to open the file.
http://www.mvps.org/access/api/api0018.htm

-Tom.
Microsoft Access MVP
 

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

Similar Threads


Back
Top