I am using the following code to print all of the word documents .docx in a designated folder.
How should I change this code so that it prints in the alpha-numerical order that the files names appear in the folder?
Thanks in advance
Private Sub CommandButton21_Click()
Dim sMyDir As String
Dim sDocName As String
' The path to obtain the files.
sMyDir = "\Folder Path"
sDocName = Dir(sMyDir & "*.DOCX")
While sDocName <> ""
' Print the file.
Application.PrintOut FileName:=sMyDir & sDocName
' Get next file name.
sDocName = Dir()