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 41 42 43 44 45 46 47 48
|
Sub Macro33()
'
' Macro33 Macro
' Macro enregistrée le 16/12/2008 par blondelle
'
ActiveDocument.MailMerge.MainDocumentType = wdEnvelopes '2
ActiveDocument.Envelope.DefaultSize = "DL"
ActiveDocument.Envelope.Insert Address:="", ReturnAddress:=""
Selection.Font.Size = 8
Selection.Font.Name = "Arial"
Selection.TypeText Text:="blondelle jean-pierre"
Selection.TypeParagraph
Selection.TypeText Text:="chemin"
Selection.TypeParagraph
Selection.TypeText Text:="quartier"
Selection.TypeParagraph
Selection.TypeText Text:="30000 Ville"
Selection.TypeParagraph
Selection.TypeText Text:="France"
ActiveDocument.Envelope.Address.Select
Selection.MoveDown Unit:=wdLine, Count:=2 '5
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:="Prenom"
Selection.TypeText " "
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:="Nom"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:="ADRESSE"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:="CODE_POSTAL"
Selection.TypeText " "
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:="Ville"
ActiveDocument.MailMerge.OpenDataSource Name:="C:\tableau.xls", _
ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="", SQLStatement:="", SQLStatement1 _
:="", SubType:=wdMergeSubTypeOther '0 , 0
With ActiveDocument.Envelope.AddressStyle.Font
.Bold = True
.Name = "Times New Roman"
.Size = 16
End With
ActiveDocument.MailMerge.Execute
End Sub |
Partager