0

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)

skaffman
  • 398,947
  • 96
  • 818
  • 769
Roeya
  • 111
  • 7

1 Answers1

0

After reading more example scripts I tried setting the fame name manually:

vFrame = ThisComponent.CurrentController.Frame 
REM Here we set the frame name manually 
vFrame.setName("MyFrame") 

While using loadComponentFromURL seems not to change the frame name, using the setName does change the frame name so after the first call to loadComponentFromURL I changed the frame using setName, and from now on it si working as expected

Roeya
  • 111
  • 7