Click to See Complete Forum and Search --> : dlgcontrol (save)


Dingojoe
May 15th, 1999, 07:27 PM
Below is the code im tryign to use.. What i want to do is when the user presses the button, the save as dlg control will pop up, then he will select what he wants to save his work as (eg... *.txt) then presses save and it will save.. The work is stored in a text box. (text1.text)

If someon can tell me what im doing worng id greatly appreciate it!!

Private Sub Command2_Click()
Dim sFile As String


If category.Text = "" Or text1.Text = "" Then
MsgBox "Nothing To Save"

Exit Sub
End If

With dlgCommonDialog
.DialogTitle = "Save As"
.CancelError = False
'ToDo: set the flags and attributes of the common dialog control
.Filter = "Text File (*.txt)|*.txt|Doc File (*.doc)|*.doc|All Files (*.*)|*.*"
.ShowSave
If Len(.FileName) = 0 Then
Exit Sub
End If
sFile = .FileName
End With
Call savetext1(text1, str2 & lstview.Text & sFile)
End Sub

?