|
-
Jun 10th, 2013, 05:57 AM
#1
Thread Starter
New Member
Open file in a running application
Hello
I have written a program in VB 6.0 that I use to organize files that I have created (in AutoCad), so that I can find them quickly without wasting time. I want to write some code that will open a file when I click on the text box containing the file path/name, I want the file to be opened in a running instance of AutoCad, not Shell out and open AutoCad with the file as a parameter. Is this possible? I hope that I have explained the problem clearly.
Thank You
John
-
Jun 10th, 2013, 08:26 AM
#2
Re: Open file in a running application
It appears you'll have to set some settings in AutoCAD first (something about single/multiple program instance) before you can open files (via ShellExecute API) in the existing instance. Follow the discussion in this AutoCAD forum.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Jun 10th, 2013, 11:26 PM
#3
Thread Starter
New Member
Re: Open file in a running application
Thank you for this information. I am finding out about ShellExecute now.
Thanks
John
-
Jun 10th, 2013, 11:34 PM
#4
Thread Starter
New Member
Re: Open file in a running application
http://support.microsoft.com/kb/170918
This is an explanation of shellexecute using vb 6.0
-
Jun 11th, 2013, 12:01 AM
#5
Thread Starter
New Member
Re: Open file in a running application
http://support.microsoft.com/kb/170918
the information in this article solved the problem completely
thanks again
john
-
Jun 11th, 2013, 12:44 AM
#6
Re: Open file in a running application
Glad to hear it! 
You may now mark this thread Resolved!
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|