title: How to select a folder only by using common dialog control
body: <p>Using VB6</p>
  
  <p>Code.</p>
  
  <pre><code>CommonDialog1.DialogTitle = "Open File"
  CommonDialog1.Filter = "*.*"
  CommonDialog1.FilterIndex = 1
  CommonDialog1.Flags = cdlOFNAllowMultiselect + cdlOFNExplorer
  CommonDialog1.Flags = cdlOFNFileMustExist + cdlOFNHideReadOnly
  CommonDialog1.CancelError = True
  On Error Resume Next
  CommonDialog1.ShowOpen
  If Err Then
      'MsgBox "Select Folder"
      Exit Sub
  End If
  </code></pre>
  
  <p>From the above code, i am selecting a file, But i don't want to select a file, I want to select only the folder. How to modify my code.</p>
  
  <p>Need vb6 code Help?</p>