Link to home
Start Free TrialLog in
Avatar of hltan
hltan

asked on

Append value to text file

Hi,

Can any one show me how to open a text file, and add something inside? Which means, I have a text file, I open it (already contains something inside), and now I want to add one line string (result) to this file at the last line of this text file.

It's possible to do this?

Please help.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of stefanx
stefanx

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hltan
hltan

ASKER

Hi stefanx,

Do you mind to tell me why Const should be added in front of the Fname and F = FreeFile?


Const FName = "c:\My Documents\thefile.txt"
Dim F As Integer

F = FreeFile

Thanks.

Probably has "Option Explicit" turned on. If you have it off, you won't need the declare lines.