opening a file

I have in a DB-program an UNC-path to a file. This file may be of any type that is recognized by the Client-PC. Now I want to open this file. The shell-statement only works for exe's and what by example for a Word-document? How can I open this without I use the shell-statement to start Word. I can not use the shell-statement because the file can be of any type.
jntj405Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mcriderCommented:
You can use:

shell "start filename.ext",vbNormalFocus

to start any file extension that is associated with an application...

so if .DOC is associated with word, and the document is myfile.doc this will start word with the file myfile.doc:

shell "start myfile.doc",vbNormalFocus

Cheers!
0
jntj405Author Commented:
That won't work by me. I get always the error: 'File not found'. Can you give me some more info?

It must work with NT, 95 and 98.
0
mcriderCommented:
try:

shell "c:\windows\command\start mydoc.doc",vbNormalFocus

Cheers!
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

jntj405Author Commented:
This may work under 95 and 98.
But I'm sure that it does not under NT.
There is no file start*.*. And certainly no command-directory.
0
mcriderCommented:
If that doesnt work, try this Microsoft KB document:

HOWTO: Use ShellExecute to Launch Associated File (32-bit)
http://support.microsoft.com/support/kb/articles/Q170/9/18.asp

 Cheers!
0
mcriderCommented:
ShellExecute is a Win32 API call... The URL I gave you has a complete example of how to use it...


Cheers!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jntj405Author Commented:
mcrider,

Thank you for your comment. When I copy the start.exe to NT. I works fine!!!

Thank you.

Can you give an answer. I will accept it.
0
jntj405Author Commented:
Thank you
0
mcriderCommented:
If you have time, try the API interface, it will work on NT without the START.EXE...

Cheers!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.