I'd like to add a command before everything where the user can browse for a file to be edited. Also it needs to be able to resave the edited file with the same name, but different extension. As it stands now, the file has to be named tom.acl and I need to have the ability to run it on all acl files without having to rename them.
Basically open *.acl --> edit file --> save *.cl
Here's what I've got so far:
Private Sub Command1_Click()
Dim first, last, Space As String
Dim OutRecord(80), NewRecord As String
Space = " "
Open App.Path & "\Tom.Acl" For Input As #1
Open App.Path & "\Tom.cl" For Output Shared As #2
' Read in record reformat and write out
' Remove col 1 len 8 left just
Do While Not EOF(1) ' Loop until end of file.
Line Input #1, first ' Read data
'Debug.Print first ' Print data to Debug window.
'
'OutRecord
i = 0
For j = 9 To 80
i = i + 1
OutRecord(i) = Mid(first, j, 1)
Next
' perpare output record
i = 0
NewRecord = Space
Do While i < 80
NewRecord = NewRecord & OutRecord(i)
i = i + 1
Loop
'Write #2,
Print #2, NewRecord
Loop
Close #1 ' Close file.
Close #2
Command1.Visible = False ' Set to invisible.
Command2.Visible = True ' Set to visible.
End Sub
Private Sub Command2_Click()
End
End Sub
Basically open *.acl --> edit file --> save *.cl
Here's what I've got so far:
Private Sub Command1_Click()
Dim first, last, Space As String
Dim OutRecord(80), NewRecord As String
Space = " "
Open App.Path & "\Tom.Acl" For Input As #1
Open App.Path & "\Tom.cl" For Output Shared As #2
' Read in record reformat and write out
' Remove col 1 len 8 left just
Do While Not EOF(1) ' Loop until end of file.
Line Input #1, first ' Read data
'Debug.Print first ' Print data to Debug window.
'
'OutRecord
i = 0
For j = 9 To 80
i = i + 1
OutRecord(i) = Mid(first, j, 1)
Next
' perpare output record
i = 0
NewRecord = Space
Do While i < 80
NewRecord = NewRecord & OutRecord(i)
i = i + 1
Loop
'Write #2,
Print #2, NewRecord
Loop
Close #1 ' Close file.
Close #2
Command1.Visible = False ' Set to invisible.
Command2.Visible = True ' Set to visible.
End Sub
Private Sub Command2_Click()
End
End Sub