DeleteFile VBA Attachmate Reflections - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

DeleteFile VBA Attachmate Reflections

airwolf09airwolf09 Posts: 2Member
I am trying to delete the first line of text file using Attachmate Reflections 2011 VBA script. But the code does not work. How can I use "DeleteLines 1, 1"? any help would be appreciated.


Const ForReading = 1, ForWriting = 2, ForAppending = 3
Dim fs, f

Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("C:Batch_Manipulator_File.txt", ForWriting, TristateFalse)

f.Write "Hello world!"
f.DeleteLines 1, 1
f.Close

fs.CopyFile "C:Temp.txt", True
Sign In or Register to comment.