Private Sub Label13_Click()
10
FileName = InputBox("请输入文件名", "保存文件")
On Error Resume Next
If FileName = "" Then
msg = MsgBox("处理之前必须输入一个文件名", vbRetryCancel, "错误提示")
If msg = 2 Then Exit Sub
GoTo 10
Else
If filepath = "" Then
filepath = App.Path
Else
End If
Label14.Caption = "生成的程序文件保存在  " & filepath & "\" & FileName
End If
Open filepath & "\" & FileName For Output As #1
Write #1, "%"
Write #1, O01
Write #1, "G54 G91"
Write #1, "S" & Text2.Text & "M3"
Close #1
End Sub
生成文件如下:
"%"
"O01"
"G54 G91"
"S1000M3"
希望生成文件如下:
%
O01
G54 G91
S1000 M3
请问代码怎样处理才生成这种格式文件.谢谢