opening files from Access form using Windows default applications

  • Thread starter Thread starter mog
  • Start date Start date
M

mog

Dear Colleagues,

I want to open a file from an Acess form using the registered default
Windows application, just as if I were to double-click on the file name
in Windows Explorer or click Start, Run, and enter the file path and
name. I want to use a shortcut menu; so if I select the command on a
..jpg file, the Windows default jpg editor opens the file. If I select
the command on a .xls file, I want Excel to opent the spreadsheet.

I tried the Shell command but it doesn't work.

with kind regards,

mog
 
mog wrote in message said:
Dear Colleagues,

I want to open a file from an Acess form using the registered default Windows
application, just as if I were to double-click on the file name in Windows
Explorer or click Start, Run, and enter the file path and name. I want to use
a shortcut menu; so if I select the command on a .jpg file, the Windows
default jpg editor opens the file. If I select the command on a .xls file, I
want Excel to opent the spreadsheet.

I tried the Shell command but it doesn't work.

with kind regards,

mog

The Shell function should normally work, though it would need quoting
etc if there are spaces or special characters in the path - it is
usually
recommended to add errornumber/messages and the bombing code
to the question, as it will help when assisting.

But you could have a look at this wrapper for he ShellExecute API
http://www.mvps.org/access/api/api0018.htm
 
Thanks Roy, solves the problem. The SellExecute wrapper works a treat.
Exactly what I wanted. Many many thanks!
 

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

Back
Top