Skip to content

GetNextFileName Method

Description

Returns a string that contains all of the file names selected in the Open File Dialog if the Multiselect option was set.

Syntax

Public Function GetNextFileName() As String

Return Type

Returns a string that contains all of the file names selected in the Open File Dialog if the Multiselect option was set.

Remarks

The GetNextFileName method is used to loop through the string of file names that were selected in the Open File Dialog if the Multiselect option was set.

Example

This sample illustrates how to loop through the list of files selected from the Open File Dialog if the Multiselect option was set.

CommonDialog2.FileName = ""  
CommonDialog2.Flags = cdlOFNAllowMultiselect  
CommonDialog2.ShowOpen  

Dim FileName As String  
FileName = CommonDialog2.FileName  

Do  
    Debug.Print FileName  
    FileName = CommonDialog2.GetNextFileName  
Loop While FileName <> ""  

See Also

CommonDialog Control


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.