2 messages in org.openoffice.fr.progRe: [prog] [Calc] Passer d'une fenêtr...
FromSent OnAttachments
NojidJan 21, 2006 12:22 pm 
JovialJan 22, 2006 8:37 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] [Calc] Passer d'une fenêtre à une autreActions...
From:Jovial (o.jo@free.fr)
Date:Jan 22, 2006 8:37:53 am
List:org.openoffice.fr.prog

Nojid a écrit :

Bonjour Quelle commande doit-on utiliser dans une macro pour demander à Calc de passer du Document1 au Document2 déjà ouvert ? Merci

Regarde cette macro

Sub ActiveJournalDevant ActiveJournal("Devant") End Sub Sub ActiveJournal(position as variant) Dim PropFich(), arg(0) as new com.sun.star.beans.PropertyValue Dim lesDocs as Object, unDoc as Object' DocJournal as Object Dim URLjournal as String Dim laCollection as Object Dim DocOuvert as Long MonDoc = ThisComponent 'Sélectionne le document en cours MaFeuille = MonDoc.CurrentController.ActiveSheet ' sélectionne la feuille activée

DocOuvert = 0 arg(0).Name="MacroExecutionMode" arg(0).Value = com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE_NO_WARN 'on crée le chemin / repertoire au format URL URLjournal = TraiteURL("RepertoireCible")& FichierJournal lesDocs=stardesktop.components on error resume next laCollection = lesDocs.createEnumeration do while laCollection.hasMoreElements unDoc=laCollection.nextElement DocURL = unDoc.URL if DocURL = URLjournal then DocOuvert = 1 DocJournal = unDoc Exit do End if loop

if DocOuvert = 0 then DocJournal=stardesktop.loadComponentFromURL(URLjournal, "_blank", 0, arg())

End if

'Position de la fenêtre Select case position Case "PremierPlan" DocJournal.currentcontroller.frame.containerwindow.toFront Case "ArrierePlan" MonDoc.currentcontroller.frame.containerwindow.toFront Case Else 'Autre (appel par le bouton Journal) DocJournal.currentcontroller.frame.containerwindow.toFront End select

End Sub

Jean-Luc