Sub manu()
'activer la référence "Microsoft Word xx.x Object Library"
Dim Cible As String
Dim AppWord As Object 'Word.Application
Dim DocWord As Object 'Word.Document
Dim CollWord As Object 'Word.Words
Dim i As Long, j As Long
Cible = "C:\test\test3.doc"
Set AppWord = CreateObject("Word.Application")
'Set AppWord = New Word.Application
AppWord.Visible = False
Set DocWord = AppWord.Documents.Open(Cible)
Set CollWord = DocWord.Content.Words
For i = 1 To CollWord.Count
'Cells(i, 10) = RTrim(CollWord(i))
t = ""
'gestion des Maisons
If InStr(1, LCase(CollWord(i)), "maison") > 0 Then
j = j + 1
t = CollWord(i)
For x = i + 1 To Application.WorksheetFunction.Max(i + 10, CollWord.Count)
If Right(CollWord(x), 1) <> " " Then
t = t & CollWord(x)
Else
t = t & CollWord(x)
Exit For
End If
Next x
Cells(j, 1) = t: Cells(j, 2) = Cible
End If
'gestion des jardins
If InStr(1, LCase(CollWord(i)), "jardin") > 0 Then
j = j + 1
t = CollWord(i)
For x = i + 1 To Application.WorksheetFunction.Max(i + 10, CollWord.Count)
If Right(CollWord(x), 1) <> " " Then
t = t & CollWord(x)
Else
t = t & CollWord(x)
Exit For
End If
Next x
Cells(j, 1) = t: Cells(j, 2) = Cible
End If
Next
DocWord.Close True
AppWord.Quit
Set DocWord = Nothing
Set AppWord = Nothing
End Sub