Skip to content

Dialog Properties Reference ​

📋 Property List ​

PropertyTypeDescription
DialogTitleStringDialog title
InitialDirStringInitial directory
DefaultExtStringDefault extension
FileNameStringDefault/selected filename
FilterStringFile filter
MultiSelectBooleanAllow multi-select
OverwritePromptBooleanPrompt for overwrite on save
PathMustExistBooleanPath must exist
FileMustExistBooleanFile must exist
HideReadOnlyBooleanHide read-only checkbox
NewDialogStyleBooleanUse new dialog style

🏷️ DialogTitle Property ​

Description ​

Sets or gets the text displayed in the dialog title bar.

Syntax ​

vb
Public Property Let DialogTitle(ByVal vValue As String)
Public Property Get DialogTitle() As String

Example ​

vb
Dim dlg As New cDialog
dlg.DialogTitle = "Please select file to open"
Dim file As String
file = dlg.ShowOpen

📁 InitialDir Property ​

Description ​

Sets or gets the initial directory when dialog opens.

Syntax ​

vb
Public Property Let InitialDir(ByVal vValue As String)
Public Property Get InitialDir() As String

Example ​

vb
dlg.InitialDir = "C:\Users\Documents"

📎 DefaultExt Property ​

Description ​

Sets or gets the default file extension (without dot).

Syntax ​

vb
Public Property Let DefaultExt(ByVal vValue As String)
Public Property Get DefaultExt() As String

Example ​

vb
dlg.DefaultExt = "txt"  ' Default save as .txt file

📄 FileName Property ​

Description ​

Sets default filename or gets user-selected filename.

Syntax ​

vb
Public Property Let FileName(ByVal vValue As String)
Public Property Get FileName() As String

Example ​

vb
' Set default filename
dlg.FileName = "New Document.txt"

' Get selected filename (after ShowOpen/Save)
Dim selected As String
selected = dlg.FileName

🔍 Filter Property ​

Description ​

Sets or gets file filter string. Format: Description1|Pattern1|Description2|Pattern2

Syntax ​

vb
Public Property Let Filter(ByVal vValue As String)
Public Property Get Filter() As String

Example ​

vb
' Set filter directly
dlg.Filter = "Text Files|*.txt|All Files|*.*"

' Use AddFilter method
dlg.AddFilter "Text Files", "*.txt"
dlg.AddFilter "All Files", "*.*"

☑️ MultiSelect Property ​

Description ​

Sets or gets whether to allow multi-file selection.

Syntax ​

vb
Public Property Let MultiSelect(ByVal vValue As Boolean)
Public Property Get MultiSelect() As Boolean

Example ​

vb
dlg.MultiSelect = True
Dim files As Collection
Set files = dlg.SelectFiles  ' Returns Collection

⚠️ OverwritePrompt Property ​

Description ​

Sets or gets whether to prompt for overwrite when saving file that already exists.

Syntax ​

vb
Public Property Let OverwritePrompt(ByVal vValue As Boolean)
Public Property Get OverwritePrompt() As Boolean

Example ​

vb
dlg.OverwritePrompt = True  ' Enabled by default

✅ PathMustExist Property ​

Description ​

Sets or gets whether path must exist.

Syntax ​

vb
Public Property Let PathMustExist(ByVal vValue As Boolean)
Public Property Get PathMustExist() As Boolean

Example ​

vb
dlg.PathMustExist = True  ' Enabled by default

📋 FileMustExist Property ​

Description ​

Sets or gets whether file must exist (open dialog only).

Syntax ​

vb
Public Property Let FileMustExist(ByVal vValue As Boolean)
Public Property Get FileMustExist() As Boolean

Example ​

vb
dlg.FileMustExist = True  ' Enabled by default

🎨 NewDialogStyle Property ​

Description ​

Sets or gets whether to use new dialog style (folder selection dialog).

Syntax ​

vb
Public Property Let NewDialogStyle(ByVal vValue As Boolean)
Public Property Get NewDialogStyle() As Boolean

Example ​

vb
dlg.NewDialogStyle = True  ' Use new style with edit box

Last Updated: 2026-05-17

VB6 and LOGO copyright of Microsoft Corporation