I'd like to open various types of files...

E

Eddie

There are many different kinds of files in shared directory.
In Access form, I can save them with saveas dialog.
At now, I want to open them automatically, i.e. when I select
..zip file with command button, the zip file should be opened with
winzip, when I select .xls file, MS Excel shoud open the file.

Is there any good idea for this?

Thanks in advance.
 
D

Dirk Goldgar

Eddie said:
There are many different kinds of files in shared directory.
In Access form, I can save them with saveas dialog.
At now, I want to open them automatically, i.e. when I select
.zip file with command button, the zip file should be opened with
winzip, when I select .xls file, MS Excel shoud open the file.

Is there any good idea for this?

Thanks in advance.

I think this link may be what you're looking for:

http://www.mvps.org/access/api/api0018.htm
API: Start an app with ShellExecute
 
A

Albert D.Kallal

To open a file, and launch the appropriate application, you can use:

application.FollowHyperlink "c:\path to your document"

So, to open a word document, you can go:

application.FollowHyperlink "c:\mydocs\test.doc"

To open excel, you can go:

application.FollowHyperlink "c:\mydocs\test.xls"
 
Top