Hi,
I am using Dir() to get files from the directory and its working well in Word 2011 but in the same code is not working in Word 2016 MAC.
Please check the below code and advise.
Here is my code....
Function GetFileList(folderPath As String) As Collection
Dim file As String
Dim returnCollection As New Collection
If Right$(folderPath, 1) <> Application.PathSeparator Then
folderPath = folderPath & Application.PathSeparator
End If
file = Dir$(folderPath)
Do While Len(file) > 0
returnCollection.Add folderPath & file
file = Dir$
Loop
Set GetFileList = returnCollection
End Function
I need to get files from a directory...
Thanks and regards,
Dhanaraj
I am using Dir() to get files from the directory and its working well in Word 2011 but in the same code is not working in Word 2016 MAC.
Please check the below code and advise.
Here is my code....
Function GetFileList(folderPath As String) As Collection
Dim file As String
Dim returnCollection As New Collection
If Right$(folderPath, 1) <> Application.PathSeparator Then
folderPath = folderPath & Application.PathSeparator
End If
file = Dir$(folderPath)
Do While Len(file) > 0
returnCollection.Add folderPath & file
file = Dir$
Loop
Set GetFileList = returnCollection
End Function
I need to get files from a directory...
Thanks and regards,
Dhanaraj