Sub Test374()
For i = 1 To 3
Dim Wapp As Object, doc As Object
On Error Resume Next 'si Word n'est pas ouvert
Set Wapp = GetObject(, "Word.Application")
If Wapp Is Nothing Then Set Wapp = CreateObject("Word.Application")
Wapp.Visible = True
Wapp.Activate
With Wapp
.Documents.Add
With .ActiveWindow.Selection
.TypeText "Test fonctionnement sur Word" & vbLf & vbLf
.TypeText "Ligne 2" & vbLf
End With
End With
Application.Wait Now + 3 / 86400 'attente 5 secondes pour tester
For Each doc In Wapp.Documents: doc.Saved = True: Next 'pas d'enregistrement demandé
Wapp.Quit 'ferme Word
Application.Wait Now + 3 / 86400 'attente 5 secondes pour tester
Next i
End Sub