Save file dynamically with suffix
I need a Macro that can save a Word document based on data from a text file. This is because the data will be set dynamically in the Text file on a hard drive. The only thing it needs is a file path. One tricky part is I want it to count the files in the directory and append 0001 to the first file and then 0002, 0003, and 0004, respectively.
For example, in directory C:\Temp I wil have a file name worddocs.txt. That file only will contain a base file path. e.g. C\myDocs\wordsOfWisdon.docx. That is, until it is appended with the file names. Each time it saves, it should be appended with 0001, 0002, 0003... So the file name would be wordsOfWisdon0001.docx. I want a button to press and save it with this filename.
I have tried some VBA in the past, but I do not know about accessing the external text file. Thanks for any help.
|