H
hans.list
I'm trying to get this macro (that I found on the web) to run on my Mac. It gives an error in the line that starts with "strFile":
Sub DocsToDocx()
Dim strPath As String
Dim strFile As String
Dim doc As Document
' Path should end with semicolon
strPath = "SSD:Users:Hansropbox:CTrj:test:"
strFile = Dir(strPath & "*.doc") 'error here
End
Do While strFile <> ""
If Right(strFile, 3) = "doc" Then
Set doc = Documents.Open(fileName:=strPath & strFile)
If doc.HasVBProject Then
doc.SaveAs fileName:=strPath & strFile & "m", _
FileFormat:=wdFormatXMLDocumentMacroEnabled
Else
doc.SaveAs fileName:=strPath & strFile & "x", _
FileFormat:=wdFormatXMLDocument
End If
doc.Close SaveChanges:=False
End If
strFile = Dir
Loop
End Sub
How can I fix this?
Many thanks!
Hans
Sub DocsToDocx()
Dim strPath As String
Dim strFile As String
Dim doc As Document
' Path should end with semicolon
strPath = "SSD:Users:Hansropbox:CTrj:test:"
strFile = Dir(strPath & "*.doc") 'error here
End
Do While strFile <> ""
If Right(strFile, 3) = "doc" Then
Set doc = Documents.Open(fileName:=strPath & strFile)
If doc.HasVBProject Then
doc.SaveAs fileName:=strPath & strFile & "m", _
FileFormat:=wdFormatXMLDocumentMacroEnabled
Else
doc.SaveAs fileName:=strPath & strFile & "x", _
FileFormat:=wdFormatXMLDocument
End If
doc.Close SaveChanges:=False
End If
strFile = Dir
Loop
End Sub
How can I fix this?
Many thanks!
Hans