
SAMPLE CODE

'This code is used to save text document

Private Sub mnuSave_Click()

    ATX451.FileName = App.Path & "\test.atx" 'Set file name to save as
    ATX451.DataType = Rich_Text_format 'Set the datatype of file to save as
    ATX451.SelStart = 0
    ATX451.SelLength = ATX451.TextLength 'Select contents of document
    ATX451.FileSave = 1  'Save file
    
End Sub

	OR

Private Sub mnuFileSaveAs_Click()

    On Error GoTo SaveErrHandler    'turn error trapping on
    dlgEdit.CancelError = True
    dlgEdit.Flags = cdlOFNOverwritePrompt + cdlOFNPathMustExist
    dlgEdit.Filter = "All File (*.*)|*.*|ALLText File (*.atx)|*.atx|Rich Text File (*.rtf)|*.rtf|Text File (*.txt)|*.txt"
    dlgEdit.ShowSave
    ATX451.FileName = dlgEdit.FileName 'Select file to open and load into ALLText
    ATX451.DataType = Rich_Text_format
    ATX451.SelStart = 0
    ATX451.SelLength = ATX451.TextLength 'Select contents of document
    ATX451.FileSave = 1  'Save selected contents to a new file name
    frmview.Caption = "ALLText Editor - " & dlgEdit.FileName
    blnChange = False
    blnCancelSave = False
    ATX451.Select = 0
    ATX451.UnDoAction = 0
    Exit Sub
SaveErrHandler:
    blnCancelSave = True
    
End Sub
