VBA

Moderators: PavlinII
Number of threads: 1614
Number of posts: 3000

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
DeleteFile VBA Attachmate Reflections Posted by airwolf09 on 7 Dec 2012 at 6:39 PM
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



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.