macropod -- I opened a blank x.docx, saved your latest revision as a macro named SplitDocuments, and ran that macro. It opened a dialog saying "Choose a folder." That proved to be a request for both the source and destination folder. The macro ran, and it worked. It produced one extra blank .docx file for each source .txt file, but no quibble -- those were easy enough to delete. I'm guessing it saw the ending .pa as the start of a new section and, as gmayor says, another and probably better solution would be to remove that ending .pa before processing the files. It probably shouldn't have been there anyway.
I can only thank you both, again, for the time and effort you've put into this project. I think my learning will really begin when I adapt what you've done to try to produce a macro that will process other old text files.
Regarding which, I misspoke earlier. The .pa ending code was apparently from WordStar, which I probably stopped using in the late 1980s. One new set of .txt files will be XyWrite files, though, with codes like «MDUL» and «MDNM». But those aren't the delimiters; those are for (underline) and (return to normal). I think the delimiters are semicolons. It will surely be simple to adapt your macros to that.
Let me just editorialize that it was a lot easier in WordPerfect. If memory serves, I could write end-user-intelligible macros that were largely created just by telling WP to watch what I was doing and remember it. Then search for .pa, cut and paste into a new doc, edit a bit, and go. I think Word has a parrot feature too, but I believe I tried and couldn't get it to work like that.
Anyway, thanks again.
|