Hi,
You should open a text stream to the newly created file. Dim fso as new filesystemobject Dim ts as TextStream Dim tmpFile as string tmpFile = "C:\Logs\SomeFileName.txt") Fso.createtextfile(tmpfile,true) Set ts= fso.OpenTextFile(tmpfile,ForAppending) Ts.writeline "TEST" Ts.writeline "TEST2" Ts.close Set ts=Nothing Tim From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bennett, Brian Sent: Tuesday, January 29, 2008 8:45 AM To: '[email protected]' Subject: [Talk] CreateObject questions. Morning all. If I do the following in step 1: Set fs = CreateObject ("Scripting.FilesystemObject") Set a = fs.CreateTextFile ("c:\logs\somefilename.txt", True) And then in step 2: a.WriteLine ("Some text goes here") a.WirteLine ("Some more text goes here") I get an error in step 2 since I have left the sub in step 1. Do I need to Dim a as ?, or do I need to set a= fs before I can write to a, for each step that I need to write to? Thanks. Brian Bennett Affinity Health Systems PBS\Clinic Billing (920)628-9055 [EMAIL PROTECTED] CONFIDENTIALITY NOTICE: This message and any included attachments are from Salinas Valley Memorial Hospital and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Salinas Valley Memorial Healthcare System's Privacy Officer in Salinas, California, U.S.A at (+1) (831) 755-0751.
