Am Donnerstag, den 19.01.2006, 13:05 +0100 schrieb Felix E. Klee:
> 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?

I see two possibilities: you can modify the MediaDesrciptor used on
loading a new doc or the target frame could be "_default" instead of
"_blank". Check chapter "6.1.5  Handling Documents" of the Developers
Guide for more in depth information.

HTH,
Marc


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to