vb保存txt保存数对齐问题
Private Sub Command8_Click()List3.AddItem Label3 & Text1
List3.AddItem Text2 & Combo2
List3.AddItem Label6 & Text32 & Label80 & Text4
List3.AddItem Label31 & " " & Label32 & " " & Label34 & " " & Label33 & " " & Label35
List3.AddItem Combo19 & " " & Combo3 & " " & Text7 & " " & Text6 & " " & Text3
List3.AddItem " --------------------------------------- "
List3.AddItem Combo16 & " " & Combo4 & " " & Text12 & " " & Text21 & " " & Text14
List3.AddItem Text49 & Text47 & " " & Combo10 & " " & Text9 & " " & Text8 & " " & Text11
List3.AddItem Combo15 & " " & Combo6 & " " & Text18 & " " & Text17 & " " & Text15
List3.AddItem Combo14 & " " & Combo5 & " " & Text19 & " " & Text20 & " " & Text16
List3.AddItem Combo17 & " " & Combo11 & " " & Text10 & " " & Text38 & " " & Text13
List3.AddItem Combo13 & Label55 & " " & Combo7 & " " & Text25 & " " & Text24 & " " & Text22
List3.AddItem Combo12 & Label71 & " " & Combo8 & " " & Text26 & " " & Text27 & " " & Text23
List3.AddItem Frame10 & Text28
exittxt:
CommonDialog1.CancelError = True
On Error GoTo a
CommonDialog1.Filter = "all files(*.*)|(*.*)|text file(*.txt)|*.txt"
CommonDialog1.FilterIndex = 2
CommonDialog1.Flags = &H2 '保存的时候如果有同名文件提示是否替换
CommonDialog1.ShowSave
lujing = CommonDialog1.FileName
If lujing <> "" Then
Open lujing For Output As #1
For i = 0 To List3.ListCount - 1
Print #1, List3.List(i)
Next
Close #1
End If
a:
List3.Clear
Exit Sub
保存数对齐问题,当其中一位空是就出现不对齐了,能不能有更好的方法,请教各位