Interesting question. What you'd have to do is write a macro to parse up your text file and as part of that macro, write the macro you want to write. Is that recursive enough for you? What you are going to have to do is manipulate the Visual Basic Editor 6.0 Object Model to drive your macro creation. In Office XP Developer, the Visual Basic Editor 6.0 Object Model is discussed under the Microsoft Office XP Developer Object Model Guide, Shared Components section of the documentation. The ins and outs are in the VBOB6.CHM help file. When you install Office XP, make sure to check that you want all the programming help/VBA files installed so you get it installed.
This was first published in December 2001