Appending Txt file with a Return

Results 1 to 2 of 2

Thread: Appending Txt file with a Return

  1. #1
    Ed Guest

    Default Appending Txt file with a Return

    Here is some code I am using to append a text file. Now it just appends to the same line. What I want to do is append the to a new line. Here is what I have so far....<BR><BR>&#060;%<BR>Const ForReading = 1, ForWriting = 2, ForAppending = 8<BR>Dim fso, f <BR>Set fso = CreateObject("Scripting.FileSystemObject")<BR>Set f = fso.OpenTextFile("c: estfile.txt",ForAppending, True)<BR>f.Write "Hello world!" + Return<BR>%&#062;<BR><BR>Any help would be much appreciated,<BR><BR>Ed

  2. #2
    Join Date
    Dec 1969
    Posts
    915

    Default RE: Appending Txt file with a Return

    Try f.writeline instead. If this does not work, you could append a vbCrLf at the end of the line.<BR><BR>f.Write "The Text!" & vbCrLf<BR><BR>Good Luck<BR>Jerry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •