#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default FileDialog

Hello -
I have created a File picker for selecting pictures and assigning the picked
files to semi-colon seperated string variables. It works fine, except that
the files are displayed in descending order. They must be shown in ascending
order for my purposes. I can't figure out what is causing this. When the
filedialog is running, you can right click on it and select "arrange by name"
to toggle back and forth from ascending to descending. I can't find the VBA
representation of "arrange by". Please look over my code and show me where I
am going wrong... or suggest a work around:


Dim fd As FileDialog, lstStr As String, loopCtr As Integer
Set fd = Application.FileDialog(msoFileDialogFilePicker)
Dim vrtSelectedItem As Variant

With fd
.FilterIndex
.Filters.Clear
.InitialView = msoFileDialogViewPreview
.InitialFileName = FolderPath
.Filters.Add IMAGEFILES, IMAGETYPES
.AllowMultiSelect = True

If .Show = True Then
loopCtr = 0
lstStr = FileNamesPaths.Value
ShortStr = ShortFileName.Value
For Each vrtSelectedItem In .SelectedItems
FilesArray = vrtSelectedItem
loopCtr = loopCtr + 1
lstFilesSelected.AddItem vrtSelectedItem
lstStr = lstStr & vrtSelectedItem & ";"
If Me.CheckBox1.Value = True Then
ShortStr = ShortStr & Replace(currentTitle, " ", "_") & "_" &
loopCtr & "." & FunctionGetFileExt(vrtSelectedItem) & ";"
Else
ShortStr = ShortStr & FunctionGetFileName(vrtSelectedItem) & ";"
End If
Next vrtSelectedItem
FileNamesPaths.Value = lstStr
ShortFileName.Value = ShortStr
Else
'The user pressed Cancel.
Exit Sub
End If
End With

--
Thanks,
Mike
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
using a filedialog box from a dll Paul Excel Programming 2 April 26th 06 04:56 PM
FileDialog AMDRIT Excel Programming 1 October 21st 05 10:17 PM
filedialog Norm Excel Worksheet Functions 0 July 29th 05 10:17 PM
FileDialog Help Maynard Excel Programming 0 August 4th 04 01:43 PM
FileDialog Jag Man Excel Programming 3 February 2nd 04 04:50 AM


All times are GMT +1. The time now is 06:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"