Best way to open a file in its native app with VB code?

I am creating a file and I would like for it to open into its native application right after I create it.  What is the best way to accomplish this task?
joesmowAsked:
Who is Participating?
 
Richie_SimonettiConnect With a Mentor IT OperationsCommented:
You were not clear enoght so i will post some possible ways:
'find executable for a given file
http://www.mvps.org/vbnet/code/system/findexecutable.htm

' open a file with default associated exe
http://www.mvps.org/vbnet/code/shell/shellexecute.htm

If you plan to open that file with your program, you need to do an entry in registry and add and extension, so when file is doble-clicked, it will be open with your app.
Your program must read Command$ variable to get avobe mentioned.
Hope it helps

0
 
eeevansCommented:
If the native application is associated to open files with the extension of the file you create you can simply call Shell(sFilename, vbNormalFocus) if you want it to appear to the user or with vbMinimizedFocus if you don't want it to appear to the user.  It depends a lot on the type of native application that opens the file.  If it's not associated with the file extension you may need to figure out where the application is and then put the application path and name followed by a space and your filename.

Regards,
eeevans
0
 
planoczCommented:
What is going to be your native application?
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
joesmowAuthor Commented:
The native app will be AutoCAD.
0
 
Richie_SimonettiIT OperationsCommented:
And
' create file association with VB.
http://www.mvps.org/vbnet/index.html?code/reg/association.htm
0
 
joesmowAuthor Commented:
The native app will be AutoCAD.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.