Option ExplicitFunction OnClick(ByRef ClickData) Dim dlg, File, Folder, FSO, i, k, list, path path = DOpus.FSUtil.Resolve("/dopusdata\Filters\") Set list = DOpus.NewVector Set FSO = CreateObject("Scripting.FileSystemObject") If FSO.FolderExists(path) Then Set Folder = FSO.GetFolder(path) i = 0 For Each File In Folder.Files If LCase(FSO.GetExtensionName(File.Name)) = "ofi" Then list(i) = FSO.GetBaseName(File.Name) i = i + 1 End If Next End If Set dlg = ClickData.Func.Dlg dlg.title = "Select By Filter" If list.count > 0 Then dlg.message = "Check filter(s) to select files and/or folders:" dlg.buttons = "OK|Cancel" dlg.choices = list dlg.list = DOpus.NewVector() Else dlg.message = "No ofi-files found in the filters directory." dlg.icon = "info" dlg.buttons = "OK" End If dlg.Show If dlg.result = 1 And list.count > 0 Then For k = 0 To dlg.choices.size - 1 If dlg.list(k) Then ClickData.Func.Command.RunCommand("Select FILTER=""" & dlg.choices(k) & "") End If Next End IfEnd Function