While attempting to run the marco below I get the following error on the line bolded in the macro:
4605 This command is not available
[VBA] Sub replace_client(sPath As String)
Dim oDoc As Word.Document
With Application
Set oDoc = .Documents.Open(sRoot & sPath)
With oDoc.Content.Find
.ClearFormatting
.Text = "Student"
With .Replacement
.ClearFormatting
.Text = "Client"
End With
.Execute Replace:=wdReplaceAll
End With
oDoc.Close True
End With
Set oDoc = Nothing
End Sub
[/VBA]
While looking for this error explaination on the net it looks like one of the possibilities is a bad file name. The files I am trying to loop through have special characters in the file names (-). Could this be causing the problem?
If so is there a way to loop through the files and remove the spaces. There are around 300 files all named this way.
In previous tests I was using files with straight data. The files I am going through, have tables, and other forms in them.
Thanks