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

Re: Syntax to get filename list from Multi-select Open file Dialog by Patrick

Patrick
Mon Feb 26 19:26:20 CST 2007

In article <#4sOn3fWHHA.896@TK2MSFTNGP05.phx.gbl>, bilboB@yahoo.com
says...
> 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.

--
Patrick Steele
http://weblogs.asp.net/psteele