below code, which works just fine, performs a search and replace actions on multiple files in a given directory. C:\test\
I would like to run this code on subfolders as well, ie. in the above case, there are several folders under C:\test\, ie.
How is the code to be rewritten so that subfolders also get worked on.
Help is much appreciated. Thank you very much in advance.
Dim strFile As String
Dim i As Integer
Dim doc As Document
Dim rng As Range
Const strFolder = "C:\test\"
strFile = Dir$(strFolder & "*.docx")
Do Until strFile = ""
Set doc = Documents.Open(strFolder & strFile)
For Each rng In doc.StoryRanges
.Text = "Rev. 1.0"
.Replacement.Text = "Rev 1.1"
.Replacement.Font.Size = 9
.Forward = True
.Wrap = wdFindContinue
strFile = Dir$()