Hi Felix, I didn't try it, but perhaps this might help: Document.getCurrentController().getFrame().getContainerWindow().toFront()
Martin > -----Original Message----- > From: Felix E. Klee [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 19, 2006 1:06 PM > To: [email protected] > Subject: [api-dev] Document is loaded in a background window > > Try out the following code. It loads the file "/tmp/bar.sxw" and > afterwards > displays a message box. The problem is that the file is loaded in a > background window, at least on my system. I.e. the current window > obscures > the window with the new document. > > Sub Test1 > Dim NoArgs() As New com.sun.star.beans.PropertyValue > Dim Service As Object > Service = createUnoService("com.sun.star.frame.Desktop") > Dim Document As Object > Document = Service.loadComponentFromURL("file:///tmp/bar.sxw", > _ > "_blank", 0, NoArgs()) > MsgBox "foo" > End Sub > > To get rid of the problem I found two solutions, but neither is > satisfactory: > > * Don't display the message box > > * Close the window in front by using setVisible: > > StarDesktop.CurrentFrame().getContainerWindow().setVisible(False) > > So, what do you suggest? How do I make the window with the new document > appear > in the foreground? Or, alternatively, how do I lower the current window? > > -- > Dipl.-Phys. Felix E. Klee > Email: [EMAIL PROTECTED] (work), [EMAIL PROTECTED] (home) > Tel: +49 721 8307937, Fax: +49 721 8307936 > Linuxburg, Goethestr. 15A, 76135 Karlsruhe, Germany > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
