Results 1 to 6 of 6

Thread: Open file in a running application

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2010
    Posts
    7

    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

  2. #2
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    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)

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2010
    Posts
    7

    Re: Open file in a running application

    Thank you for this information. I am finding out about ShellExecute now.
    Thanks
    John

  4. #4

    Thread Starter
    New Member
    Join Date
    Feb 2010
    Posts
    7

    Re: Open file in a running application

    http://support.microsoft.com/kb/170918

    This is an explanation of shellexecute using vb 6.0

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2010
    Posts
    7

    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

  6. #6
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    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
  •  



Click Here to Expand Forum to Full Width