5 messages in org.openoffice.fr.prog[prog] Ouverture de fichier via macro
FromSent OnAttachments
THEVENOUX Jean-PhilippeJun 23, 2005 3:29 am 
Laurent GodardJun 23, 2005 3:37 am 
Jean...@i-carre.netJun 23, 2005 3:44 am 
THEVENOUX Jean-PhilippeJun 23, 2005 4:08 am 
Laurent GodardJun 23, 2005 4:39 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:[prog] Ouverture de fichier via macroActions...
From:THEVENOUX Jean-Philippe (jp.t@atolcd.com)
Date:Jun 23, 2005 3:29:19 am
List:org.openoffice.fr.prog

Bonjour

Je cherche a ouvrir un fichier au format CSV via une macro. Ma macro ressemble a cela :

dim oDoc as object dim Args(0) as new com.sun.star.beans.PropertyValue Args(0).Name = "FilterName" Args(0).Value = "Text - txt - csv (StarCalc)" Args(0).Name = "FilterOptions" Args(0).Value = "9/44,39,STANDARD,1,1/1/2/1/3/1" oDoc = StarDesktop.LoadComponentFromURL(ConvertToURL(CheminSource + "Fichier.csv"),"_blank",0,Args())

Ca marche tres bien, ca m'ouvre un classeur avec les données bien rangés. Le problème c'est que l'extension de fichier que je doit ouvrir est ".txt" et si je change le "Fichier.csv" en "Fichier.txt" (alors que c'est le même fichier qui est juste renommé), le fichier s'ouvre avec Writer, en tant que document texte !!!

Comment faire pour que mon fichier "Fichier.txt" s'ouvre avec Calc et non avec Writer ??

Merci d'avance

Jean-Philippe

PS : Avec l'interface d'OpenOffice, il tout a fait possible d'ouvrir le fichier txt en tant que format CSV, donc on "doit" pouvoir le faire