View contents of this chapter

File Open/Save Dialog Box

The following table shows the Flags property values that you can assign before applying the ShowOpen and ShowSave method.

Literal Flags
value
Description
cdlOFNAllowMultiselect &H200 Specifies that the File Namelist box allows multiple selections.
cdlOFNCreatePrompt &H2000 Specifies that the dialog box prompts the user to create a file that doesn't currently exist. This flag automatically sets the cdlOFNPathMustExist and cdlOFNFileMustExist flags.
cdlOFNExplorer &H80000 Use the Explorer-like Open A File dialog box template.
CdlOFNExtensionDifferent &H400 Indicates that the extension of the returned filename is different from the extension specified by the DefaultExt property.
cdlOFNFileMustExist &H1000 Specifies that the user can enter only names of existing files in the File Name text box.
cdlOFNHelpButton &H10 Causes the dialog box to display the Help button.
cdlOFNHideReadOnly &H4 Hides the Read Only check box.
cdlOFNLongNames &H200000 Use long filenames.
cdlOFNNoChangeDir &H8 Forces the dialog box to set the current directory to what it was when the dialog box was opened.
CdlOFNNoDereferenceLinks &H100000 Do not dereference shell links (also known as shortcuts). By default, choosing a shell link causes it to be dereferenced by the shell.
cdlOFNNoLongNames &H40000 Do not use long file names.
CdlOFNNoReadOnlyReturn &H8000 Specifies that the returned file won't have the Read Only attribute set and won't be in a write-protected directory.
cdlOFNNoValidate &H100 Specifies that the common dialog box allows invalid characters in the returned filename.
cdlOFNOverwritePrompt &H2 Causes the Save As dialog box to generate a message box if the selected file already exists.
cdlOFNPathMustExist &H800 Specifies that the user can enter only valid paths.
cdlOFNReadOnly &H1 Causes the Read Only check box to be initially checked when the dialog box is created.
CdlOFNShareAware &H4000 Specifies that sharing violation errors will be ignored.

Often, when you see a File-related dialog box such as the File Open dialog box, a filter is applied to filename extensions so that the dialog box shows files of a certain extension only. The following statement assigns a filter that shows only Word and Power point documents when the Open dialog box appears:

dlgOpen.Filter = "Word Docs (*.doc)|*.doc| Powerpoint files ( *.ppt)|*.ppt"

 



© Universal Teacher Publications        INDEX Previous Screen Next Screen