I am using OO 3.0 and according to the official openoffice documentation (http://wiki.services.openoffice.org/wiki/Documentation/BASIC_Guide/StarDesktop) in order to replace the document this is the code required:
Dim Doc As Object
Dim Dummy()
Dim Url As String
Dim SearchFlags As Long
SearchFlags = com.sun.star.frame.FrameSearchFlag.CREATE + _
com.sun.star.frame.FrameSearchFlag.ALL
Url = "file:///C:/test.odt"
Doc = StarDesktop.loadComponentFromURL(Url, "MyFrame", SearchFlags, Dummy)
MsgBox "Press OK to display the second document."
Url = "file:///C:/test2.odt"
Doc = StarDesktop.loadComponentFromURL(Url, "MyFrame", SearchFlags, Dummy)
I tried it and it is not working, tried both from VB and OO Basic what am I missing ? (I used all flags 23+8 and even 55 as the search flags mask)