The common dialog is a "Browse For File" control, not a "Browse For Folder" control. To folder browse, use this:
VB Code:
  1. Public Function BrowseForFolder(hWndOwner As Long, sPrompt As String) As String
  2.  
  3.     Dim iNull As Integer
  4.     Dim lpIDList As Long
  5.     Dim lResult As Long
  6.     Dim sPath As String
  7.     Dim udtBI As BrowseInfo
  8.  
  9.     With udtBI
  10.         .hWndOwner = hWndOwner
  11.         .lpszTitle = lstrcat(sPrompt, "")
  12.         .ulFlags = BIF_RETURNONLYFSDIRS
  13.         .lpfnCallback = PassBackAddress(AddressOf BrowseCallBackProc)
  14.     End With
  15.  
  16.     lpIDList = SHBrowseForFolder(udtBI)
  17.     If lpIDList Then
  18.         sPath = String$(MAX_PATH, 0)
  19.         lResult = SHGetPathFromIDList(lpIDList, sPath)
  20.         Call CoTaskMemFree(lpIDList)
  21.         iNull = InStr(sPath, vbNullChar)
  22.         If iNull Then
  23.             sPath = Left$(sPath, iNull - 1)
  24.         End If
  25.     End If
  26.  
  27.     BrowseForFolder = sPath
  28.  
  29. End Function
  30.  
  31. Private Sub cmdBrowse_Click()
  32. Dim sDocFolderPath As String
  33. sDocFolderPath = BrowseForFolder(Form1.hWnd, "Select A Folder")
  34. If sDocFolderPath <> "" Then
  35.     'store selected folder in textbox
  36.     Text1.Text = sDocFolderPath
  37. End If
  38. End Sub