Example

This example uses GetOpenFileName to allow the user to select a file. The dialog box caption says "Select a Reflection settings file," but all files are listed. GetFileType is used to determine the file type of the selected file. If the file is identified as a Reflection settings file, a message displays the file name. If it is not, a message is displayed saying the file was not a settings file.

Sub PickAFileAnyFile ()

 Dim file As String

 Dim fileType As Integer

 With Session

  'Have user select a file

  file = .GetOpenFilename(, , _

     "Select a Reflection Settings File", "Select")

 

  'Determine the file type

  fileType = .GetFileType(file)

 

  'Perform different actions based on the file type

  If fileType = rcSettings Then

   MsgBox "You selected " & file

  Else

   MsgBox "That was not a settings file for this Reflection product"

  End If

 End With

End Sub