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
| Sub test()
Dim CHEMIN, NOMMODELE As String
Dim WordApp As Object
Dim WordDoc As Object
'Définition des variables
Sheets("Phoning").Activate
CHEMIN = ActiveWorkbook.Path & "\"
NOMMODELE = "Confirmer un RDV by NEOTOUCH.docx"
i = ActiveCell.Row
'on ouvre l'instance Word
Set WordApp = CreateObject("Word.Application")
WordApp.Visible = True
Set WordDoc = WordApp.Documents.Open(CHEMIN + NOMMODELE)
With WordApp
'On gère les signets de texte
j = 3
'CLIENT
.Selection.Goto what:=wdGoToBookmark, Name:="CLIENT"
.Selection.TypeText Text:=Cells(i, j)
End With
WordDoc.Close False
WordApp.Quit
End Sub |
Partager