

![]() | 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.prog[prog] AIDE PUBLIPOSTAGE| From | Sent On | Attachments |
|---|---|---|
| Teddy Gestel | May 22, 2006 1:42 am | |
| Bernard Marcelly | May 22, 2006 2:43 am | |
| André Baudoin | May 22, 2006 2:44 am | |
| André Baudoin | May 22, 2006 3:24 am | |
| MABILLE Bruno SZSIC57-IML | May 22, 2006 7:19 am | |
| André Baudoin | May 23, 2006 11:54 pm | |
| Bernard Marcelly | May 24, 2006 1:18 am | |
| André Baudoin | May 24, 2006 2:15 am | |
| Bernard Marcelly | May 24, 2006 2:57 am | |
| André Baudoin | May 24, 2006 4:38 am | |
| Bernard Marcelly | May 24, 2006 8:10 am | |
| André Baudoin | May 28, 2006 11:55 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: | [prog] AIDE PUBLIPOSTAGE | Actions... |
|---|---|---|
| From: | Teddy Gestel (tedd...@implicit.com) | |
| Date: | May 22, 2006 1:42:24 am | |
| List: | org.openoffice.fr.prog | |
Bonjour,
Jessai de faire une macro de publipostage :
Je me suis inspiré du livre Programmation Openoffice 2 pages 569 et 609 et de ooforum.org.
Sauf que je souhaite utiliser un fichier txt comme source de données.
Les données de ce fichier ont :
1ere ligne : La liste des colonnes séparée par des TABULATION.
2eme ligne : Les données
EXEMPLE du fichier:
CT_CopieTuteurReferent CT_DateDuJour
BLABLABLABLABLABLABLA 18-05-2006
Néanmoins quand je cree ma source de données elle est crée mais ne reconnaît pas le contenu du fichier.
Jai limpression quil ne sait pas pour les TABULATION.
Comment le lui faire comprendre ?
Pour le publipostage, Jai une erreur pour : .CommandeType = com.sun.star.sdb.CommandType.TABLE
Merci pour votre aide.
Voici mon code :
Sub PublipostageFLATTEXTE()
Dim NomSource As String
Dim DocumentModele As String, RepertoireCible As String
Dim NomTable As String, NomChampTitreFichier As String
Dim monPublipostage As Object, MyProps()
Dim aDocURL As New com.sun.star.util.URL
Dim sDbName As String
Dim oDbContext As Object
Dim oDbInstance As Object
Dim oMailMerge As Variant
Dim monDocBase As Object
' xray aDocURL
oDbContext = CreateUnoService("com.sun.star.sdb.DatabaseContext")
If oDbContext.hasByName("THE_DOCMOD_SOURCE") Then
MsgBox("THE_DOCMOD_SOURCE EXISTE DEJA")
oDbContext.revokeObject("THE_DOCMOD_SOURCE")
End If
Dim Chemin As String
Chemin = ConvertToURL("E:\data.dat")
oDbInstance = oDbContext.createInstance()
monDocBase = oDbInstance.DatabaseDocument
oDbInstance.DatabaseDocument.storeAsURL(ConvertToURL("E:\data.odb"), Array())
oDbInstance.URL = "sdbc:flat:" & Chemin
oDbContext.registerObject("THE_DOCMOD_SOURCE", oDbInstance)
monDocBase.store
NomSource = "THE_DOCMOD_SOURCE"
DocumentModele = "E:\DOCMOD.stw"
RepertoireCible = "E:\"
monPublipostage = createUnoService("com.sun.star.text.MailMerge")
With monPublipostage
.DataSourceName = NomSource
.CommandeType = com.sun.star.sdb.CommandType.TABLE
.Command = "THE_DOCMOD_SOURCE"
.OutputType = com.sun.star.text.MailMergeType.FILE
.FileNameFromColumn = False
.execute(MyProps())
End With
MsgBox "Fin du Publipostage"
End Sub
MERCI POUR VOTRE AIDE







