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
| Sub data_source_wd()
Application.ScreenUpdating = False
Dim wApp As Word.Application
'vous saisissez au clavier : =lorem(10,10) suivi de Entrée,
Dim oDoc As Word.Document
Set wApp = New Word.Application
'FichierTest_ = ActiveWorkbook.Name
chemin = "C:\Users\41793\desktop\"
nomfichier = "copierselection.docm"
Set oDoc = wApp.Documents.Open(chemin & nomfichier)
'à partir d'ici je n'ai pas plu adapter le code à mon objectif, et pour cause.
oDoc.Selection.Find
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "2.2.2 Alerted and Passed messages*2.2.3 Alerted and 'Failed' messages"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.Copy
'Workbooks(FichierTest_).Activate
ActiveSheet.Paste
End Sub
Sub bidules() |