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?
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

' open a file with default associated exe

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

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.

What is going to be your native application?
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.
Richie_SimonettiIT OperationsCommented:
' create file association with VB.
joesmowAuthor Commented:
The native app will be AutoCAD.
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.