Thread: [Solved] Determining merge order
View Single Post
 
Old 06-16-2014, 07:23 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Does using FileSystemObject guarantee the sort order? Another way of handling this, without resorting to FileSystemObject, would be to use:
Code:
    Dim FileArray() As String
    Dim i As Long
    'Loop while there are still files to process
    Do While File <> ""
        i = i + 1
        ReDim Preserve FileArray(i)
        FileArray(i) = File
        File = Dir
    Loop
    WordBasic.SortArray FileArray
    For i = 1 To UBound(FileArray)
        Set Target = Documents.Open(FileName:=Folder & FileArray(i), AddToRecentFiles:=False, Visible:=False, ReadOnly:=True)
...
    Next
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote