If List1.ListCount > 0 Then
ReDim a(List1.ListCount - 1) As String '定义变量a,用来存储listbox的list
Dim i As Integer, k As String
For i = 0 To UBound(a)
a(i) = List1.List(i) '将list全部存储到a()中
Next i
k = Join(a(), vbCrLf) '将a()的以回车为分隔符保存到k中
Open (App.Path & "/url.txt") For Output As #1
Print #1, k
Close #1 '输出k
End If上面这个是直接掩盖保存到url.txt我是想让他弹出另存为对话框 我好自己重命名

解决方案 »

  1.   

    If List1.ListCount > 0 Then
    ReDim a(List1.ListCount - 1) As String '定义变量a,用来存储listbox的list
    Dim i As Integer, k As String
    For i = 0 To UBound(a)
    a(i) = List1.List(i) '将list全部存储到a()中
    Next i
    k = Join(a(), vbCrLf) '将a()的以回车为分隔符保存到k中
    CommonDialog1.Filter = "文本文件(*.Txt)|*.txt"
    CommonDialog1.CancelError = True
    On Error GoTo zzz
    CommonDialog1.ShowSaveOpen CommonDialog1.FileName For Output As #1
    Print #1, k
    Close #1 '输出k
    End Ifzzz:
      

  2.   

    首先Ctrl+t里面找到"Microsoft Common Dialog Ctrol..."