Solution close first the dialog and then close OOo
sub main
DialogLibraries.loadLibrary("Standard")
d = CreateUnoDialog(DialogLibraries.Standard.Dialog1)
d.execute()
sub CommandButton1 (Dialog1 as Object)
d.endexecute()
closeprog()
end sub
sub closeprog()
stardesktop.terminate()
End sub
ub terminateOOo
oSearchDialog = CreateUnoDialog( DialogLibraries.Hulp.Dialog1 ) ' Dit maak een verbinding naar de dialoog
oSearchDialog.Execute() ' en dit maakt het zicht baar
thiscomponent.store
thiscomponent.close(true)
stardesktop.terminate
end sub
Set StarDesktop = objServiceManager.createInstance("com.sun.star.frame.Desktop")
StarDesktop.terminate
-errrrr no! I took the script direct from the link from your link at post 3. Trying to be clever, I reckoned that uninstalling LO would do the trick. Ha! Silly me. Script now cannot find the class from Set objServiceManager= WScript.CreateObject("com.sun.star.ServiceManager").Can't your script specify the application to use?
sub Lopetus
Rem rutiini, joka lopettaa OpenOffice-istunnon
Rem EI TALLENNA MITÄÄN!
Rem Muokannut: Risto Jääskeläinen
Rem Part from A. Pitoynak
Dim oDesktop As Object, oDocs As Object
Dim oDoc As Object, oComponents As Object
Dim i as Integer 'i counts how many windows are open in OOo
i = 0
oComponents = StarDesktop.getComponents()
oDocs = oComponents.createEnumeration()
Do While oDocs.hasMoreElements()
oDoc = oDocs.nextElement()
oDoc.dispose()
Loop
Rem Nauhoitettua osuutta
rem ----------------------------------------------------------------------
rem define variables
'dim document as object
'dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
'document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
'dispatcher.executeDispatch(document, ".uno:Quit", "", 0, Array())
Wait 1000 'Tässä sen salaisuus?
dispatcher.executeDispatch(StarDesktop, ".uno:Quit", "", 0, Array())
end sub 'Lopetus
sub Lopetus2
Rem rutiini, joka lopettaa OpenOffice-istunnon
Rem EI TALLENNA MITÄÄN!
Rem Muokannut: Risto Jääskeläinen
Rem Part from A. Pitoynak
Dim oDesktop As Object, oDocs As Object
Dim oDoc As Object, oComponents As Object
oComponents = StarDesktop.getComponents()
oDocs = oComponents.createEnumeration()
Do While oDocs.hasMoreElements()
oDoc = oDocs.nextElement()
oDoc.dispose()
Loop
Wait 1000 'Ei voi olla ainakaan < 500 !
Rem Raaka peli, suljetaan prosessi käyttöjärjestelmän puolelta:
Shell("c:\windows\system32\taskkill.exe",2,"/F /iM soffice.bin")
end sub 'Lopetus2
Users browsing this forum: No registered users and 10 guests