From the Word VBA:
Using the Dir() method on a Mac does not like the * wildcard. I do not use a Mac but am trying to help someone out. The help file indicates that it should work, but it is unsuccessful.
You should only have to change the format of the path. This snipit should echo back the name of each .wmp file in the directory.
Works on a PC
Doesn't work on a Mac
If we replace the * with an actual filename, it echos back the filename properly. It just seems to be having trouble with the wildcard.
Any help would be greatly appreciated.
Using the Dir() method on a Mac does not like the * wildcard. I do not use a Mac but am trying to help someone out. The help file indicates that it should work, but it is unsuccessful.
You should only have to change the format of the path. This snipit should echo back the name of each .wmp file in the directory.
Works on a PC
Code:
Dim sPath As String
Dim sFile As String
sPath = ActiveDocument.Path & "\"
sFile = Dir(sPath & "*.wpm")
Do While sFile <> ""
MsgBox sFile
sFile = Dir
Loop
Code:
Dim sPath As String
Dim sFile As String
sPath = ActiveDocument.Path & ":"
sFile = Dir(sPath & "*.wpm")
Do While sFile <> ""
MsgBox sFile
sFile = Dir
Loop
Any help would be greatly appreciated.