

![]() | 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: |
2 messages in org.openoffice.fr.progRe: [prog] Publipostage avec macro| From | Sent On | Attachments |
|---|---|---|
| MABILLE Bruno SZSIC57-IML | May 23, 2007 1:53 am | |
| Philippe Allart | May 23, 2007 2:34 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] Publipostage avec macro | Actions... |
|---|---|---|
| From: | Philippe Allart (pall...@cudl-lille.fr) | |
| Date: | May 23, 2007 2:34:20 am | |
| List: | org.openoffice.fr.prog | |
MABILLE Bruno SZSIC57-IML a écrit :
Lorsque j'utilise l'assistant mailing par Outils - Assistant mailing, j'effectue correctement mon publipostage. Par contre si je veux recommencer un publipostage, je dois d'abord quitter le démarrage rapide puis relancer OOo sinon la macro plante lors de l'enregistrement de la source de données. Après cette manipulation, il est impossible de supprimer le fichier .ODB, un message de violation de partage s'affichant.
J'ai longtemps buté sur ce problème. On peut créer une source de données sans enregistrer un .odb. Voici quelques bout de codes qui pourraient aider:
========================================================= ' ' Créer une source de donnée à partir d'un fichier CVS ' Function CreerSourceSurCSV(cheminCSV as String, _ decimalDel as String, champDel as String, ChaineDel as String, _ optional extension as string) as Variant
dim monDBContext As Object, uneInstance as Object dim chemin as String dim info(3) as New com.sun.star.beans.PropertyValue
if isMissing(extension) then extension = "csv"
CreerSourceSurCSV = null
monDBContext = CreateUnoService("com.sun.star.sdb.DatabaseContext")
chemin = ConvertToUrl(cheminCSV) uneInstance = monDBContext.CreateInstance() uneInstance.URL = "sdbc:flat:" & chemin info(0).Name = "DecimalDelimiter" info(0).Value = decimalDel info(1).Name = "Extension" info(1).Value = extension info(2).Name = "FieldDelimiter" info(2).Value = champDel info(3).Name = "StringDelimiter" info(3).Value = chaineDel uneInstance.info() = info
CreerSourceSurCSV = uneInstance end Function
' ' Se connecter à une source ' => renvoie une connexion ' Function ConnecterSource(maSource as Object, _ optional login as String, optional passwd as String) as Variant Dim monDbContext as Object
if isMissing(login) then login = "" if isMissing(passwd) then passwd = ""
ConnecterSource = maSource.getConnection(login,passwd) End Function
' ' Mettre fin à une connexion ' sub FinConnexion(maConnexion as Object) maConnexion.close maConnexion.dispose end Sub ================================================================
La source n'est créée qu'en mémoire. Tout s'effface quand l'application se termine.
Au dernières nouvelles, il y a un petit souci de reconnaissance des formats quand on mappe une source sur un CSV. Il vaut mieux convertir le CSV en .ods en spécifiant les formats, puis créer la source sur le .ods.
Je peux fournir le code qui va bien pour ça, si tu veux.
Ph.
--







