Great idea, colleague! Let’s try together (Forum.ods):
Sub Test2
Dim oDP, oDialog
StarDeskTop.loadComponentFromUrl ("private:factory/scalc", "_blank", 0, Array())
oDP=GetProcessServiceManager.createInstanceWithArguments("com.sun.star.awt.DialogProvider", Array(ThisComponent))
oDialog = oDP.createDialog( "vnd.sun.star.script:Standard.Dialog1?location=document")
oDialog.execute
End Sub
Macro works.
CreateUnoDialog - to the archive.
To open a dialog in non-modal mode, you need to replace the line
oDialog.execute
with
oDialog.Visible=True
and make oDialog a global variable.
In this option, the script execution flow is terminated. No need “loop trick”.
To end the dialog, you can use a macro assigned to handle pressing a button, or a listener like @JohnSUN 's.
oDialog.Visible=False