https://bugs.documentfoundation.org/show_bug.cgi?id=172029

--- Comment #5 from BogdanB <[email protected]> ---
This is the macro, for any other tests:
Sub SaveOnClose
    Dim oDoc As Object
    Dim sURL As String
    oDoc = ThisComponent

    If Not oDoc.isModified Then Exit Sub

    If oDoc.hasLocation And Not oDoc.isReadOnly Then
        oDoc.store()
        MsgBox "Document saved.", 64, "Auto-Save"

    Else
        MsgBox "This is a new document. Please choose where to save it.", 48,
"Save Required"

        Dim FilePicker As Object
        FilePicker = CreateUnoService("com.sun.star.ui.dialogs.FilePicker")

       
FilePicker.initialize(Array(com.sun.star.ui.dialogs.TemplateDescription.FILESAVE_AUTOEXTENSION))
        FilePicker.appendFilter("ODF Text Document (.odt)", "*.odt")

        If FilePicker.execute() Then
            sURL = FilePicker.Files(0)
            oDoc.storeAsURL(sURL, Array())
            MsgBox "Document saved successfully.", 64, "Success"
        End If
    End If
End Sub

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to