Message 1 of 3

Not applicable
05-08-2014
11:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I really don't think this is too hard, but here it goes. I'll post my code below. I've enabled muti-select. After the user selects whatever files they want, it's supposed to populate the list box. Instead, it concatenates it all onto one line separated by "|" for each file. Any ideas of how to get them to separate?
Private Sub cmdSourceAdd_Click() Dim oFileDlg As FileDialog ' Create a new FileDialog object. Call ThisApplication.CreateFileDialog(oFileDlg) ' Define the filter to select part and assembly files or any file. oFileDlg.Filter = "Inventor Files (*.iam;*.ipt;*.idw;*.dwg)|*.iam;*.ipt;*.idw;*.dwg|All Files (*.*)|*.*" ' Define the part and assembly files filter to be the default filter. oFileDlg.FilterIndex = 1 oFileDlg.MultiSelectEnabled = True ' Set the title for the dialog. oFileDlg.DialogTitle = "Open File Test" ' Set the initial directory that will be displayed in the dialog. 'oFileDlg.InitialDirectory = ThisApplication.FileOptions.ProjectsPath ' Set the flag so an error will be raised if the user clicks the Cancel button. oFileDlg.CancelError = True ' Show the open dialog. The same procedure is also used for the Save dialog. ' The commented code can be used for the Save dialog. On Error Resume Next oFileDlg.ShowOpen ' oFileDlg.ShowSave ' If an error was raised, the user clicked cancel, otherwise display the filename. If Err Then MsgBox "User cancelled out of dialog" ElseIf Not oFileDlg.fileName = "" Then lstSource.AddItem oFileDlg.fileName 'WHAT GOES HERE??? End If End Sub
Solved! Go to Solution.