マクロ用に次のコードがあります。ただし、サブディレクトリは通過しません。それを編集する方法を誰か教えてもらえますか?
Sub ChangeTemplates()
Dim strDocPath As String
Dim strTemplateB As String
Dim strCurDoc As String
Dim docCurDoc As Document
' set document folder path and template strings
strDocPath = "C:\Users\servicedesk\Desktop\Test\"
strTemplateB = "C:\Users\servicedesk\Desktop\Blanco.dotx"
' get first doc - only time need to provide file spec
strCurDoc = Dir(strDocPath & "*.doc")
' ready to loop (for as long as file found)
Do While strCurDoc <> ""
' open file
Set docCurDoc = Documents.Open(FileName:=strDocPath & strCurDoc)
' change the template
docCurDoc.AttachedTemplate = strTemplateB
' save and close
docCurDoc.Close wdSaveChanges
' get next file name
strCurDoc = Dir
Loop
MsgBox "Finished"
End Sub