Private Sub Command1_Click()
Dim i As Integer, num As Integer
Dim filePath As String
Dim strTemp As String, str1 As String
i = FreeFile
filePath = "d:\1.txt"
'将内容读取到strTemp="aaabbbddd",这里只针对你所说的情况,如果其它复杂一点的,你就要好好研究下读写文件了
Open filePath For Input As #i
Do While Not EOF(i)
Input #i, strTemp
str1 = str1 & strTemp
Loop
Close #i
'str1转换
str1 = Replace$(str1, "d", "c")
i = FreeFile
'保存到 txt 中
Open filePath For Output As #i
Print #i, str1
Close #i
End Sub