Syntax to get filename list from Multi-select Open file Dialog

E

ElmoWatson

I need to get the list of files, in a multi-select OpenFileDialog,
formatting the list for my purposes (adding to an array)

I can't seem to grasp the syntax - - here's part of what I've tried, after
creating two variables (s and sList):
Dim sList as String() '< - array I want to use

Dim ofd As New OpenFileDialog
For Each s In ofd.FileNames
' what do I put here to add the item in the array?
Next

or, is it an array anyway? If so, I do I access it?

I just need to pass an existing array to another method, using the filenames
in the OFD
 
P

Patrick Steele

I need to get the list of files, in a multi-select OpenFileDialog,
formatting the list for my purposes (adding to an array)

I can't seem to grasp the syntax - - here's part of what I've tried, after
creating two variables (s and sList):
Dim sList as String() '< - array I want to use

Dim ofd As New OpenFileDialog
For Each s In ofd.FileNames
' what do I put here to add the item in the array?
Next

or, is it an array anyway?

Yes, the Filenames property is already a string array.
If so, I do I access it?

You can use For/Each like you're doing in your sample.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top