Have written some coding to create text files from webpages created in Dreamweaver. It is attached.
It all works well apart from one thing:
I have the webpages in a folder C:/Web Design/Faith various/new website/mag articles
This contains subfolders:
and on up to Mar12
The present coding iterates through the ALL the folders and writes the data to a file 0.txt. It then does this again (writing all the data to 1.txt) and repeats up to about 60.txt, all files being identical. What I want to do is to write all the 02 files to 02.txt, then the 03 files to 03.txt and so on.
The Sub Button1_Click is called from a button on a form. This calls displayFolder. In the coding in this the sub WriteToTextFile is called which does the actual writing (you can ignore this. The coding is rather convoluted but it works!).
LoopThruDirectory does the looping, closes fsoStream, increments Filenumber (which in its turn changes the output file name from (e.g.) 0.txt to 1.txt but by that time all the data has been written to 0.txt.
I am sure it is a silly fault in the coding but I cannot find it. Would be grateful for anyone's help.