3 messages in org.openoffice.fr.progRe: [prog] Savoir si un document est ...
FromSent OnAttachments
Pascal ChantriauxAug 30, 2005 6:42 am 
Laurent GodardAug 30, 2005 7:02 am 
JovialAug 30, 2005 9:51 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] Savoir si un document est ouvertActions...
From:Jovial (o.jo@free.fr)
Date:Aug 30, 2005 9:51:47 am
List:org.openoffice.fr.prog

bonjour Regarde la macro suivant qui énumère les doc ouverts Jean-luc Dim DocOcarnet as Object Dim PropFich() Dim unDoc as Object Dim arg(0) as new com.sun.star.beans.PropertyValue

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 URLcarnet = convertToURL("c:\mes documents.tata.sxc) 'on recherche URL dans la liste des documents ouverts lesDocs=stardesktop.components on error resume next laCollection = lesDocs.createEnumeration do while laCollection.hasMoreElements unDoc=laCollection.nextElement DocURL = unDoc.URL if DocURL = URLcarnet then print " URLcarnet est ouvert" 'traitement.... End if loop

Pascal Chantriaux a écrit :

Bonjour,

Comment tester, dans une macro, si un document openoffice particulier est actuellement chargé? Par exemple, j'écris une macro qui doit être exécutée depuis "tata.sxc" mais pour laquelle il ne faut pas que "toto.sxc" soit ouvert. Je veux donc tester au début de cette macro si "toto.sxc" est chargé (en hidden ou pas).

Merci d'avance.