Results 1 to 4 of 4

Thread: [RESOLVED] Multiselect in Common Dialog Open (.FileName Not Returning List)

  1. #1

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Resolved [RESOLVED] Multiselect in Common Dialog Open (.FileName Not Returning List)

    I am using a common dialog open control to open multiple files. Here is my code.
    VB Code:
    1. 'On Error GoTo EndIt
    2.     CD1.Flags = cdlOFNAllowMultiselect + cdlOFNExplorer
    3.     CD1.InitDir = App.Path
    4.     CD1.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
    5.     'CD1.MaxFileSize = 32767
    6.     CD1.ShowOpen
    7.    
    8.     MsgBox CD1.FileName

    When I select 1 file I get a msgbox with it's full path, but if I select multiple files all that is in the msgbox is the path to the folder of the selections (and not the file names).

    If I remove the cdlOFNExplorer flag then I get the ugly Win95 dialog, but I get the proper value for CD1.Filename.

    Any ideas?
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  2. #2
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: Multiselect in Common Dialog Open (.FileName Not Returning List)

    So, you want the Class Module I use for that?

    BrowseForFolderDialog and FileDialog coming up!
    Attached Files Attached Files
    Last edited by Merri; Aug 18th, 2005 at 06:38 PM.

  3. #3

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Multiselect in Common Dialog Open (.FileName Not Returning List)

    Thanks Merri, you know what I am using them for anyway.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  4. #4
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: [RESOLVED] Multiselect in Common Dialog Open (.FileName Not Returning List)

    Yup, I know. Atleast it is a good thing they're of some use Bothered enough sometime to analyze through a few different codes and put together the ones that actually work. Hope there isn't a bug, I haven't had a throughoutly test of them. Though seems I can select a thousand files and it still works properly, so...

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