I can append to the end of a file fairly easily. Is there a simple way to just append to the beginning of the file? If not, does anyone have examples to do so?
You'll need to read the contents of the text file into a string variable, put what you want to be at the beginning of the file into another variable, and then concatenate the two:
dim theFile, theBeginning
theFile = "here's what is now in the text file"
'Obviously, the above line will need to be replaced w/ FSO methods to get the actual contents into the variable
theBeginning = "I'm going to stick this at the beginning"
dim theTextFile
theTextFile = theBeginning & theFile
Very simplified, but this is the general method you'll need to use.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.