Dir() not working in MS Word 2016 in MAC system

Joined
Feb 3, 2017
Messages
2
Reaction score
0
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top