12 messages in org.openoffice.fr.progRe: [prog] Fermer un formulaire
FromSent OnAttachments
Arnaud POUSSIERDec 12, 2006 7:17 am 
JMD Jean-Marc DelmasDec 12, 2006 9:11 am 
Arnaud POUSSIERDec 12, 2006 10:27 am 
JMD Jean-Marc DelmasDec 13, 2006 12:03 am 
Arnaud POUSSIERDec 13, 2006 12:21 am 
Arnaud POUSSIERDec 13, 2006 10:05 am 
Arnaud POUSSIERDec 13, 2006 10:07 am 
JMD Jean-Marc DelmasDec 14, 2006 2:15 am 
Arnaud POUSSIERDec 14, 2006 4:04 am 
Arnaud POUSSIERDec 14, 2006 4:12 am 
JMD Jean-Marc DelmasDec 14, 2006 9:18 am 
Arnaud POUSSIERDec 14, 2006 9:24 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [prog] Fermer un formulaireActions...
From:Arnaud POUSSIER (arna@douane.finances.gouv.fr)
Date:Dec 13, 2006 10:05:49 am
List:org.openoffice.fr.prog

JMD Jean-Marc Delmas a écrit

En fait la variable sForm est initialisée dans chaque formulaire avec le nom du formulaire à fermer. Dans "Contacts" il est initialisé à "Contacts" dans "Appels" à "Appels" dans "Adresses" à "Adresses" etc

La ligne d'appel de la macro "Fermeture" donne donc après remplacement oDispatch.executeDispatch( StarDesktop, "macro://Contacts/Standard.Lanceur.Fermeture(" & sForm & ")", "", 0, Array() )

^ ^ ^ ^

I I I I

formulaire Biblio Module Macro

où se trouve

"Fermeture" oDispatch.executeDispatch( StarDesktop, "macro://Contacts/Standard.Lanceur.Fermeture(Appels)", "", 0, Array() )

Dans la mesure où tu fermes le formulaire qui pour mon cas est le formulaire pivôt, "sForm" serait alors initialisée à "Contacts"

Cependant dans la mesure où tu n'as qu'un formulaire à fermer, s'il s'appelait "Travail" pourquoi n'utilises-tu pas directement la macro "Fermeture" en la modifiant légèrement ainsi :

Sub Fermeture Dim oDoc As Object, oFormClo As Object, oDocForms As Object, sForm As String oDoc = StarDeskTop.getCurrentComponent

oDocForms = oDoc.getFormDocuments() sForm = "Travail" oFormClo = oDocForms.getByName(sForm)

oFormClo.dispose End Sub

Un détail qui a son importance : J'utilise "StarDesktop" et pas "ThisComponent". Dans ce cas, tu ne peux pas tester pas à pas dans l'éditeur de macros. Il n'y a pas d'autre solution pour tester que de tenter la fermeture du formulaire en lançant la macro "Fermeture".

Cordialement Jean-Marc

ARNAUD POUSSIER a écrit:

Merci pour ces infos je teste et je te tiens au courant

Bonne journée

Bonsoir je viens de faire un test avec la macro fermeture et j'ai un probléme avec cette ligne

oDocForms = oDoc.getFormDocuments() "run time error basic " "propriété ou méthode introuvable"