1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| Sub AhLancerPublipostage
Dim ahNomSource as string
Dim ahDocumentModele as string, ahRepertoireCible as string
Dim ahNomTable as string
Dim ahNomChampTitreFichier as string
Dim ahNomPublipostage as Object, MyProps()
ahNomSource = "listing"
ahDocumentModele = "/Users/Admin/Desktop/données du bijou/publipostage/envelloppe-C5-public2.odt"
ahRepertoireCible = "/Users/Admin/Desktop/données du bijou/publipostage/"
ahNomTable = "listing"
ahNomChampTitreFichier = "F1"
ahMonPublipostage = createUnoService("com.sun.star.text.MailMerge")
With ahmonPublipostage
.DataSourceName = ahNomSource
.CommandType = com.sun.star.sdb.CommandType.TABLE
.Command = ahNomTable
.OutputType = com.sun.star.text.MailMergeType.FILE
.FileNameFromColumn = False
.SaveAsSinglefile = True
.FilenamePrefix = "listing"
.DocumentURL = ConvertToURL(ahDocumentModele)
.OutputURL = ConvertToURL(ahRepertoireCible)
.execute(MyProps())
End with
MsgBox "Fin du Publipostage"
Dim ahAdresseDoc As String
Dim ahPropFich(0) as New com.sun.star.beans.PropertyValue
Dim ahMonDocument as object
ahAdresseDoc=convertToURL("/Users/Admin/Desktop/données du bijou/publipostage/publipostage.pdf")
ahMonDocument=starDesktop.LoadComponentFromURL(ahAdresseDoc, "_default", 0, ahPropFich())
openAsfile=("/Users/Admin/Desktop/données du bijou/publipostage/publipostage.pdf")
End Sub |
Partager