2) See help for the "Flags" property, one of the options is to show the "confirm overwrite" message.
3) Set the CancelError property - then you will get an error if they cancel. eg:VB Code:
Private Sub saveas_Click() diabox.DialogTitle = "Save Scene As" diabox.Filter = "Scene Files (*.tsn)|*.tsn|" diabox.CancelError = True On Error Resume Next diabox.ShowSave If Err = 0 Then On Error Goto 0 '(resume normal error handling) 'save the file Open App.Path & "\Demo\Scenes\" & diabox.FileTitle For Output As #1 Print #1, diabox.FileTitle & vbNewLine & txtscenetext.Text & vbNewLine & txtnorth.Text & vbNewLine & txtsouth.Text & vbNewLine & txteast.Text & vbNewLine & txtwest.Text Close #1 End If done: End Sub




Reply With Quote