select files

Discussion in 'AutoCAD' started by Joe, Feb 9, 2005.

  1. Joe

    Joe Guest

    I tried this a long time ago and have sort of a half hearted solution that I
    would like to improve on if it's not too difficult. Is there a way to have
    the user select multiple files in a VBA program, similar to the getfiled
    lisp command?
     
    Joe, Feb 9, 2005
    #1
  2. Hi Joe,

    List and Combo boxes both have a setting to be either Single or
    Multi-select.

    In terms of ease of use - particularly with large numbers of files it's
    easier on the user to use two lists - one of the available files and one of
    the selected files - as in the "Menuload" dialog box for pop menus.

    --

    Regards,


    Laurie Comerford
    www.cadapps.com.au
     
    Laurie Comerford, Feb 9, 2005
    #2
  3. Joe

    Joe Guest

    so you saying, write a program to show a directory tree and everything? It
    seems like that code could get pretty complicated?
     
    Joe, Feb 10, 2005
    #3
  4. Hi Joe,

    Depends on what you want. If you are only looking at finding files in a
    known directory it's simple.

    If you want the user to be able to set a directory, then you need another
    level of complexity

    It you want them to set a drive - then one more.

    Here is a all you need for the first case - you can extend it to others as
    needed. For directories you will need
    sFile = Dir(sPath, vbDirectory)

    Function PopulateFiles()

    Dim sFile As String
    Const sPath = "C:\Program Files\Land desktop 3\Data\Symbol
    Manager\Landscape\"
    sFile = "*.dwg"
    sFile = Dir(sPath & sFile)

    With ComboBox1
    .Clear
    Do While sFile <> ""
    .AddItem sFile
    sFile = ""
    sFile = Dir

    Loop
    .ListIndex = 0
    End With
    End Function

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au
     
    Laurie Comerford, Feb 10, 2005
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.