<div dir="ltr">I made this macro long time ago, it used to work.<div>It does not seem to work with 4.X</div><div>It simply loads a PPT, and displays it and loops for Impress</div><div><br></div><div>can someone help me get it working again. I think it seg faults.</div><div><br></div><div>Thanks</div><div><br></div><div>I run it by:</div><div><div>export HOME=/home/silentm; export USER=silentm; export DISPLAY=:0.0; soffice --nolockcheck --nologo --norestore  "macro:///Standard.Module1.Load(file:////tmp/Clarian.ppt)"  </div></div><div><br></div><div><br></div><div>Jerry</div><div><br></div><div>------------</div><div><div><?xml version="1.0" encoding="UTF-8"?></div><div><!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"></div><div><script:module xmlns:script="<a href="http://openoffice.org/2000/script">http://openoffice.org/2000/script</a>" script:name="Module1" script:language="StarBasic">REM  *****  BASIC  *****</div><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><div><br></div><div></script:module></div></div><div><br></div></div>