<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
This does work for me, but, only if I define some global variables
in the defining module. Try setting OptionExplicit at the top of the
module and it will flag all of those undefined variables for you.<br>
<br>
Global oGlob<br>
GLobal oListener<br>
Global boFinished<br>
Global url<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">On 07/06/2015 04:54 PM, Jerry Geis
wrote:<br>
</div>
<blockquote
cite="mid:CABr8-B4tPce0whhpCmy_fwABj22a9Ho0J1T4xDzGkQm=5cGn9g@mail.gmail.com"
type="cite">
<div><br>
</div>
<div>Sub Load(arg as String)</div>
<div><br>
</div>
<div>'register a global event listener, because</div>
<div>'we have to wait until loading has finished</div>
<div>oGlob =
CreateUnoService("com.sun.star.frame.GlobalEventBroadcaster")</div>
<div>oListener =
CreateUnoListener("EvList_","com.sun.star.document.XEventListener")</div>
<div>oGlob.addEventListener(oListener)</div>
<div>boFinished = false</div>
<div><br>
</div>
<div>'hide the document while loading so that we do not see the
loading window</div>
<div>Dim aProps(2) as new com.sun.star.beans.PropertyValue</div>
<div>Dim oDoc as Object</div>
<div>aProps(0).Name = "Hidden"</div>
<div>aProps(0).Value = true</div>
<div>aProps(1).Name = "ReadOnly"</div>
<div>aProps(1).Value = true</div>
<div>url = arg</div>
<div>oDoc = StarDesktop.loadComponentFromURL(url, "_default", 0,
aProps)</div>
<div><br>
</div>
<div>'wait until loading has finished</div>
<div>while (not boFinished)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>wait(5)</div>
<div>wend</div>
<div><br>
</div>
<div>oGlob.removeEventListener(oListener)</div>
<div><br>
</div>
<div>'loading is done, set the presentation parameters</div>
<div>oDoc.Presentation.Pause = 0</div>
<div>'show the window now as presentation cannot be started</div>
<div>'(segmentation faults) if it is not</div>
<div>oDoc.CurrentController.Frame.ContainerWindow.Visible = true</div>
<div>oDoc.CurrentController.Frame.ContainerWindow.setVisible(false)</div>
<div>'start the presentation</div>
<div>oDoc.Presentation.Start</div>
<div><br>
</div>
<div>End Sub</div>
<div><br>
</div>
<div>Sub EvList_notifyEvent( o as object )</div>
<div>if o.EventName = "OnLoadFinished" then</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if
url = o.Source.Location then</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>boFinished
= true</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>endif</div>
<div>endif</div>
<div><br>
</div>
<div>End Sub</div>
<div><br>
</div>
<div>Sub EvList_disposing()</div>
<div>End Sub</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Andrew Pitonyak
My Macro Document: <a class="moz-txt-link-freetext" href="http://www.pitonyak.org/AndrewMacro.odt">http://www.pitonyak.org/AndrewMacro.odt</a>
Info: <a class="moz-txt-link-freetext" href="http://www.pitonyak.org/oo.php">http://www.pitonyak.org/oo.php</a>
</pre>
</body>
</html>