open folder in dialog box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BlackMustard
    New Member
    • Aug 2007
    • 88

    open folder in dialog box

    how do i go about to open a folder (i.e. not a file) with the common dialog open?

    more specifically, since no one has answered yet:

    i want to use a CommonDialogBox to get a folder path to a text box, but I can only find properties to get a file name. is it possible to do what i want? and how do i do so?

    -tomas
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    Use a Combination of "DriveListB ox" and a "DirListBox "..

    If using Common Dialog, use this code:

    [code=vb]
    Dim i As Integer
    Dim FoldName As String
    Dim MyFileName As String
    MyFileName = Commondialog1.F ileName
    i = Len(Dir(MyFileN ame, vbDirectory))
    FoldName = Left(MyFileName , Len(MyFileName) - i - 1)
    MsgBox FoldName
    [/code]

    Regards
    Veena

    Comment

    Working...