By last string do you mean the entire text or a portion of a longer text? If its the entire text why not delete the file and do a save as for the new file to maintain the same name?
dim Fname as string ' the path to the file
dim Raw as string
dim lines() as string
dim i as long,upper as long
Open Fname For Binary As #1
Raw = String$(LOF(1), 0)'set a buffer to the same size as the file
'Read the entire file in one operation and close it
Get #1, 1, Raw$
Close #1
lines = split(raw,vbnewline)
raw = nothing
for i = 0 to upper - 1
raw = raw & lines(i) & vbnewline
next i
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.