Get Pics by date taken

Ok lets see if i can explain this. I have a publisher file that has soem pic boxes on the document.  what we are doing now is double clicking on the Picture box and choosing the pic we want out of the directory and then going to the next box and doing the same thing. I would like to automate this with VB and have it ask me what directory then for it to grab each pic in that directory by the date and time taken and put them in order. Is this possible?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Every file has a tag that contains the creation date of that file. You can select your file by using this property of the file...
Get all files in the selected folder and store their details in an array; then order the array by the creation date. A simple example (VB2005 tested):

Public Class FIDateComparer
	Inherits Comparer(Of FileInfo)
	Public Overrides Function Compare(ByVal x As System.IO.FileInfo, ByVal y As System.IO.FileInfo) As Integer
		Return x.CreationTime.CompareTo(y.CreationTime)
	End Function
End Class
Dim f As New List(Of FileInfo)
Dim s() As String = Directory.GetFiles("c:\")
For Each n As String In s
	f.Add(New FileInfo(n))
f.Sort(New FIDateComparer())
For Each fi As FileInfo In f
	Debug.Print(fi.Name & vbTab & fi.CreationTime)

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.