ok im made a visual basic form added a 3 command buttons 1 exits and 2 go to different forms and then i have a text1 and i have a save button at the top its on the mnu but the thing is is when i put the code down theres an error on line 3. heres the code and the error is underlined

 Private Sub mnuFileSave_Click()
    Dim sFile As String
    [u]If Left$(ActiveForm.Caption, 8) = "Document" Then[/u]
        With dlgCommonDialog
            .DialogTitle = "Save"
            .CancelError = False
            'ToDo: set the flags and attributes of the common dialog control
            .Filter = "All Files (*.*)|*.*"
            .ShowSave
            If Len(.FileName) = 0 Then
                Exit Sub
            End If
            sFile = .FileName
        End With
        ActiveForm.rtfText.SaveFile sFile
    Else
        sFile = ActiveForm.Caption
        ActiveForm.rtfText.SaveFile sFile
    End If

End Sub

and my second question is instead of it saving everything as a rtf, all files, etc. how do i make it so that it will only save it as a .bat files, what should i change about it.

plz some1 help me thanks, archangel

As you said you have textbox in your form which named "ActiveForm". if I'm right so you have to write ActiveForm.text instead of ActiveForm.caption. caption is used for a lable
sadegh.mss

Hi,

ActiveForm refers to Active Child Form of the MDI Form. In your project make both the form's as Child of the mdi form, by seting MDIChild=True

Regards
Veena