So I'm trying to do a search and replace that works in the footer of a word file, but my macro is in excel. wdDoc is the document passed to the function, SearchString is the string I'm looking for (also an argument of the function), and ReplaceString is the replacement text (again an argument to the function).
With the below code, I get an error: "Type Mismatch". I get the same error if I replace wdDoc with ActiveDocument . The highlighted line is the For Each line.
Changing "With wdDoc.rStoryRange.Find" to "With rStoryRange.Find" gets me an "Argument Not Optional Error" whether I use wdDoc or ActiveDocument. The highlighted line is: Sub SandRFooter(SearchString As String, ReplaceString As String, wdDoc) in yellow, but the .Find is highlighted in blue.
Thanks for any and all help.
Bookmarks