

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
3 messages in org.openoffice.fr.progRe: [prog] Arrêter OpenOffice en lign...| From | Sent On | Attachments |
|---|---|---|
| Sébastien VINOT | Oct 18, 2007 5:55 am | |
| Didier Dorange-Pattoret | Oct 18, 2007 9:20 am | |
| Sébastien VINOT | Oct 18, 2007 9:45 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [prog] Arrêter OpenOffice en ligne de commande | Actions... |
|---|---|---|
| From: | Didier Dorange-Pattoret (ddor...@dmaths.com) | |
| Date: | Oct 18, 2007 9:20:46 am | |
| List: | org.openoffice.fr.prog | |
Bonjour,
Dans le fichier Install.odt de l'archive de dmaths, on trouve des macros qui ferment totalement OOo (Quickstarter inclus) puis le relance.
Je les ai écrites, il y a un bon moment ...
On récupère le handle de la fenêtre active de OOo
Declare Function GetActiveWindow Lib "user32" () As Long HandleWin = GetActiveWindow
puis on crée ce module dans la bibliothèque standard :
Sub CreeModuleCloseQuick rem cette macro installe un module contenant la macro qui arrête le quickstarter Dim oLib as Object, sCloseQuick as String sCloseQuick = "Rem Copyright Didier Dorange-Pattoret 2006" sCloseQuick = sCloseQuick & Chr(13) & "Declare Sub ExitProcess Lib ""kernel32"" (ByVal uExitCode As Long)" sCloseQuick = sCloseQuick & Chr(13) & "Sub CloseQuick(hWnd as Long)" sCloseQuick = sCloseQuick & Chr(13) & "ExitProcess(hWnd)" & Chr(13) & "End Sub" oLib = GlobalScope.BasicLibraries.Standard If oLib.hasByName("DmCloseQuick") Then oLib.removeByName("DmCloseQuick") EndIf oLib.InsertByName("DmCloseQuick",sCloseQuick) End Sub
La macro CloseQuick est appelée avec paramètre hWnd grace à la ligne :
sLine = sCheminOffice & " ""macro:///Standard.DmCloseQuick.CloseQuick(" & Cstr( HandleWin ) &")"""
dans un fichier batch.
C'est bricolé mais ça marche ... :-)
www.dmaths.org
Cordialement.
Sébastien VINOT a écrit :
Bonjour,
Dans le cadre d'un service UNO je souhaite créer un batch (windows oblige) mais je dois fermer openoffice préalablement. Esce possible en ligne de commande ?
Sébastien
-- Didier Dorange-Pattoret Tel : 06.85.23.38.31 Fax : 09.57.82.84.04
http://www.dmaths.org http://sesamath.net
S'inscrire à la liste de diffusion de dmaths: user...@dmaths.org
Ses archives : http://listes.dmaths.org/wws/arc/users
Les Forums : http://www.dmaths.org/forum/
Mailing List in english :
http://www.dmaths.org/documentation/doku.php?id=presentation:listdif
Le livre de référence pour OpenOffice.org2 :
http://www.amazon.fr/exec/obidos/ASIN/2212116381/dmaths-21
Programmation OpenOffice.org2 :
http://www.amazon.fr/exec/obidos/ASIN/2212117639/dmaths-21







