Need help opening a text file 
Author Message
 Need help opening a text file

I'm using this to open a file for editing in word pad, then save two
versions. One with the 6 line header and one with out.
But I can't get the wordpad part to open. Any Ideas

Dim fso, D, E, i, job
Set fso = CreateObject("Scripting.FileSystemObject")
job = inputbox("Enter Job Number")

'Need to open the Engr prn file in word pad then continue code when word pad
is closed
'Shell(wordpadpath prnpath) works in VBA

fso.DeleteFile("C:\" & job & "\DesignCriteria_Drafting.prn")
Set E = fso.OpenTextFile("c:\" & job & "\DesignCriteria_Engineering.prn", 1,
True,0)
Set D = fso.OpenTextFile("c:\" & job & "\DesignCriteria_Drafting.prn", 8,
True,0)
For i=1 to 6
 line=E.SkipLine
Next
Do While E.AtEndOfStream <> True
 D.WriteLine E.ReadLine
Loop
D.close
E.close



Tue, 24 Dec 2002 03:00:00 GMT  
 Need help opening a text file
Instead of shell you should use the ActiveX object WScript.Shell 's Run
method.

Get the WSH documentation.

--
Dominic



Tue, 24 Dec 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Need Help Opening Multiline Files in a text box

2. sample code needed to open plain text file and use as excel97 file

3. HELP,HELP needed- grabbing text from text file

4. opening / saving files with MS rich text box control (viewing open files)

5. Importing text from Text file- Help needed

6. Opening a text File -- why is path needed

7. Need help editing an Input file (text) and writing the to a new, altered Output file

8. ** File I/O ** Need help reading text file into String variable

9. Need Help, How to open a PDF file in a new window

10. Newbie needs help with an open file

11. need help: Open Excel, run macro, save file, close Excel

12. HELP NEEDED: Software to transform plain text files (UNIX) to PDF

 

 
Powered by phpBB® Forum Software