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:
Dim fso As Scripting.FileSystemObject
I suppose I have to set a reference to an object library somewhere, but where to?