Private Sub cmdStart_Click()
LoadIt
DoReplace
SaveIt
MsgBox "done"
End Sub
Private Sub LoadIt() 'Or where you want to load it.
Dim strBuff As String, intFF As Integer
List1.Clear
intFF = FreeFile
Open App.Path & "\load.txt" For Input As #intFF
Do Until EOF(intFF)
Line Input #intFF, strBuff
List1.AddItem strBuff
Loop
Close #intFF
End Sub
Private Sub DoReplace()
On Error Resume Next
Dim strString As String
Dim arrString() As String
Dim i As Long
For i = 0 To List1.ListCount - 1
strString = List1.List(i)
strString = replace(strString, "(AT)", "@")
arrString = Split(strString, " ")
List1.RemoveItem i
List1.AddItem arrString(0)
Next
List1.Refresh
End Sub
Private Sub SaveIt()
'save new file
Dim intFF As Integer, intIdx As Integer
intFF = FreeFile
Open App.Path & "\emails.txt" For Output As #intFF
For intIdx = 0 To List1.ListCount - 1
If List1.Selected(intIdx) Then Print #intFF, List1.List(intIdx)
Next
Close #intFF
End Sub
Private Sub Command1_Click()
DoReplace
End Sub