Opening a file in its relevant app

J

John

Hi

I have a field with the full path and name of a document. How can I have the
document open in its associated application; word, excel etc when user
double clicks on the field?

Thanks

Regards
 
T

Tony Toews [MVP]

John said:
I have a field with the full path and name of a document. How can I have the
document open in its associated application; word, excel etc when user
double clicks on the field?

See API: Start an app with ShellExecute
(Q) How do I start the application which is registered to handle a file extension
in Win Registry?
http://www.mvps.org/access/api/api0018.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
G

Guest

Try this
Shell "c:\program files\microsoft office\office\msaccess.exe
c:\northwind.mdb", 3
This is for an access example but it can be used for others too
 
D

Douglas J. Steele

Because of the spaces in the path, you should probably enclose it in quotes:

Shell """c:\program files\microsoft office\office\msaccess.exe""
""c:\northwind.mdb""", 3

The additional quotes around c:\northwind.mdb aren't strictly needed in this
case, but they show how you'd do it if it were c:\Some Folder\northwind.mdb.
 

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

Top