你用Input方式打开不能用PrintDim temp As StringPrivate Sub Command1_Click()
Dim filenum As Long, SeekNum As Long
Dim VarStr As String
filenum = FreeFile
SeekNum = 6
Open "c:\temp\abc.txt" For Input As filenum
Do Until EOF(filenum)
Line Input #filenum, VarStr
i = i + 1
If i <> SeekNum Then
temp = temp & VarStr & vbCrLf
Else
temp = temp & "ssssss" & vbCrLf
End If
Loop
Close #filenum
filenum = FreeFile
Open "c:\temp\abc.txt" For Output As #filenum
Print #filenum, temp
Close #filenum
End Sub
Dim filenum As Long, SeekNum As Long
Dim VarStr As String
filenum = FreeFile
SeekNum = 6
Open "c:\temp\abc.txt" For Input As filenum
Do Until EOF(filenum)
Line Input #filenum, VarStr
i = i + 1
If i <> SeekNum Then
temp = temp & VarStr & vbCrLf
Else
temp = temp & "ssssss" & vbCrLf
End If
Loop
Close #filenum
filenum = FreeFile
Open "c:\temp\abc.txt" For Output As #filenum
Print #filenum, temp
Close #filenum
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货