I've searched for this but I can't find it:
I have a listbox with numbers and I just want to save them when the user clicks Save_Click() as a SAVE AS function. I've used this, but I get errors:
VB Code:
Private Sub Command2_Click() With CommonDialog1 'open a with statement as there is a lot of code .DialogTitle = "Save" 'sets the dialog title .InitDir = "C:\" 'sets the initial directory .Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*" 'sets the file 'types .ShowSave 'show the dialog End With List2.SaveAs CommonDialog1.FileName 'save to the specified file End Sub




Reply With Quote