How to sort Directory.GetFiles(Path) based on creation date?

Hi All,

I’m trying to send emails matching two files and sending them both in the same mail from two different arrays.

As for the arrFilesPDF it filters on last modified/moved which is nice but for the arrFilesXML it filters on name… I want it to filter the array on created date.

I’ve tried to modify it with the following code:

Directory.GetFiles(strFolderPathxml).OrderByDescending(Function(x) x.LastWriteTime). However, this throws the following error:

Should follow this structure:

See workflow attached:
Sequence1.xaml (16.3 KB)

Please help

@yourubl - Please try this…

StrFilesArray=Directory.GetFiles(DirectoryPath).OrderBy(Function(d) New FileInfo(d).CreationTime).ToArray

1 Like

Thank you man! This worked like a charm! Have a great one

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.