Thank you so much, vitito.site!
I am getting a "user defined type not defined" error on the following line, both in Word and in Excel:
I suppose I have to set a reference to an object library somewhere, but where to?Dim fso As Scripting.FileSystemObject