

![]() | 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: |
4 messages in org.openoffice.fr.progRe: [prog] recupération du nom du doc...| From | Sent On | Attachments |
|---|---|---|
| Laurent Godard | Jul 1, 2005 11:11 pm | |
| Gerard Kohler | Jul 2, 2005 12:54 am | |
| Gerard Kohler | Jul 2, 2005 1:38 am | |
| Jovial | Jul 3, 2005 1:22 pm |

![]() | 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] recupération du nom du document | Actions... |
|---|---|---|
| From: | Jovial (o.jo...@free.fr) | |
| Date: | Jul 3, 2005 1:22:16 pm | |
| List: | org.openoffice.fr.prog | |
Pour retrouver un fichier ouvert il faut énumérer tous les document OOo ouvert et voir si il est dans la liste la macro ci dessous énumére tous les fichiers ouvert active le document(URLcourrier )si déjà ouvert ou l'ouvre si pas déjà ouvert.. Tu peux ensuite travailler sur le document : DocCourrier Jean-Luc
Sub ActiveCourrier Dim PropFich(), arg(0) as new com.sun.star.beans.PropertyValue Dim lesDocs as Object, unDoc as Object, DocCourrier as Object Dim URLcourrier as String Dim laCollection as Object Dim DocOuvert as Long MonDocument = ThisComponent 'Sélectionne le document en cours MaFeuille = MonDocument.CurrentController.ActiveSheet ' sélectionne la feuille activée
DocOuvert = 0 arg(0).Name="MacroExecutionMode" 'argument pour rendre le document invisible à l'utilisateur (non utilisé) arg(0).Value = com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE_NO_WARN 'on crée le chemin / repertoire au format URL URLcourrier = ConvertToURL("c:\mon répertoire\Mondoc.sxw") lesDocs=stardesktop.components on error resume next laCollection = lesDocs.createEnumeration do while laCollection.hasMoreElements unDoc=laCollection.nextElement DocURL = unDoc.URL if DocURL = URLcourrier then DocOuvert = 1 DocCourrier = unDoc exit do end if loop
if DocOuvert = 0 then DocCourrier=stardesktop.loadComponentFromURL(URLcourrier, "_blank", 0, arg()) End if DocCourrier.currentcontroller.frame.containerwindow.toFront
end sub Gerard Kohler a écrit :
bonour,
je dois l'avoir devant les yeux, mais je n'arrive pas à retouver comment faire pour récupérer le nom de fichier d'un doccument ouvert :
comment faire ?
merci de votre aide
Gérard







