mr_unreliable
Tue Jun 21 17:23:42 CDT 2005
hi Giovanni,
If you look this up on msdn, you will find this:
If the OFN_ALLOWMULTISELECT flag is set and the user selects multiple
files, the buffer contains the current directory followed by the file
names of the selected files. For Explorer-style dialog boxes, the
directory and file name strings are NULL separated, with an extra NULL
character after the last file name. For old-style dialog boxes, the
strings are space separated and the function uses short file names for
file names with spaces. You can use the FindFirstFile function to
convert between long and short file names. If the user selects only one
file, the lpstrFile string does not have a separator between the path
and file name.
To read more, here is a reference:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/commondialogboxlibrary/commondialogboxreference/commondialogboxstructures/openfilename.asp
O.k., so it looks like vbs is just looking at your result,
UP TO THE FIRST ZERO CHARACTER, and behaving like that is the end
of the string. If there are multiple selections, you may find them
stacked up AFTER the directory name, with zero terminators, and a
double-zero at the end.
Try using the "split" function to retrieve them.
If that doesn't work, you may have to use "brute force".
cheers, jw
____________________________________________________________
You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)
Reventlov (see signature) wrote:
> The file open dialog box shows a check box "READ ONLY".
> (Unless you specify the flag cdlOFNHideReadOnly = 4)
> How can the script know if the check box has been checked by the user?
>
> One more question: if multiselect is allowed I can select more than one file. But the
> FileName property does not report them all. It only reports the name of the directory. How
> can I retrieve all the filenames selected?
> Thank you very much.
> Giovanni.
>
> Set comDlg=CreateObject("MSComDlg.CommonDialog.1")
> const cdlOFNHideReadOnly = 4
> const cdlOFNAllowMultiselect = 512
> comDlg.Flags = cdlOFNHideReadOnly + cdlOFNAllowMultiselect
> comDlg.Filter = "All|*.*| VBScript|*.vbs"
> comDlg.maxfilesize=500
> comDlg.ShowOpen
> msgbox comDlg.FileName
>
> --
> Giovanni Cenati (Aosta, Italy)
> Write to user "Reventlov" and domain at katamail com
>
http://digilander.libero.it/Cenati (VbScript)