

![]() | 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: |
12 messages in org.openoffice.fr.progRe: [prog] Pointer doc sans l'ouvrir| From | Sent On | Attachments |
|---|---|---|
| Laurent Godard | Oct 15, 2004 8:44 am | |
| Jovial | Oct 15, 2004 8:44 am | |
| Alain Nowak | Oct 15, 2004 8:48 am | |
| Jovial | Oct 15, 2004 10:16 am | |
| Alain Nowak | Oct 15, 2004 10:20 am | |
| Jovial | Oct 15, 2004 10:50 am | |
| Jovial | Oct 15, 2004 5:46 pm | |
| Laurent Godard | Oct 16, 2004 12:12 am | |
| Bernard Marcelly | Oct 16, 2004 3:43 am | |
| Jovial | Oct 16, 2004 7:43 am | |
| Jovial | Oct 19, 2004 3:42 pm | |
| Jovial | Oct 20, 2004 1:48 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] Pointer doc sans l'ouvrir | Actions... |
|---|---|---|
| From: | Jovial (luck...@free.fr) | |
| Date: | Oct 19, 2004 3:42:14 pm | |
| List: | org.openoffice.fr.prog | |
Bonjour Je me suis servi des éléments que vous m'avez donné et je me suis fait la macro ci-jointe après La macro liste les documents ouverts si aucun ne correspond à celui que je veux lancer elle le charge sinon elle le document déja existant à une variable objet. Cela fonctionne bien et je peux accéder et modifier les données du document en question. Le seul problème qui me reste c'est de pouvoir mettre le document en avant plan (mettre le focus) quand il est déja ouvert comme si je cliquais sur un hyperlien.
Jean-Luc
Sub OuvrirJournal dim DocCible as object, unDoc as object dim arg(0) as new com.sun.star.beans.PropertyValue DocOuvert = 0
URLfichier= ConvertToUrl("C:\Mes documents\JournalFactures.sxc") lesDocs=stardesktop.components on error resume next laCollection = lesDocs.createEnumeration Xray.xray lesDocs do while laCollection.hasMoreElements unDoc=laCollection.nextElement oURL = unDoc.URL if oURL = URLfichier then DocOuvert = 1 DocCible = unDoc print DocCible.URL exit do end if loop
if DocOuvert = 0 then Msgbox "on charge" DocCible=stardesktop.loadComponentFromURL(URLfichier, "_blank", 0, arg()) end if
LesFeuillesCible = DocCible.sheets FeuilleCible = LesFeuillesCible.getByName("Feuille1")
CelluleCible = FeuilleCible.GetCellRangeByName("A1") msgbox CelluleCible1.formula Unezone = FeuilleCible.getCellRangeByName("A1:C1") DocCible.CurrentController.Select(UneZone)
End sub
Laurent Godard a écrit :
Bonjour Jean Luc,
Bon j'ai fait plus simple pour l'instant je me contente d'écrire dans le fichier que j'ouvre. Ce que j'ai besoin : comment savoir si il est déja ouvert et auquel cas comment le pointer ou le fermer?
tu peux regarder la collection components de stardesktop. Elle contient tous les documents ouverts. Tu peux boucler dessus pour recuperer la propriete URL, le chemin du fichier
remarque: la collection est accessible par une enumeration au sens de l'api
lesDocs=stardesktop.components laCollection = lesDocs.createEnumeration while laCollection.hasMoreElements unDoc=laCollection.nextElement print unDoc.URL wend
Pour fermer, utilse la methode close() (attention à l'EDI Basic qui ne supporte pas close mais fait partie de l'enumeration --> gerer l'erreur)
Cordialement
Laurent







