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 49 50 51 52 53 54 55 56 57
| Sub Offre_type_test()
Dim AppWord As Object
Dim DocWord As Object
Dim Nom_Fic_A_Enregistrer As String, Nom_Fenetre As String
Dim ExtGamme As String
Set AppWord = CreateObject("Word.Application")
AppWord.Visible = True
Set DocWord = AppWord.Documents.Open("C:\Users\geo\Desktop\V2.4\Offre Type.docx")
AppWord.ActiveWindow.View.ReadingLayout = False
' *******************************************************************************************
' NOM DE LA SOCIETE
' *******************************************************************************************
' Sélection des données de la fiche signalétique
Application.Goto Reference:="Nom_Client"
Selection.Copy
AppWord.Selection.HomeKey 'Unit:=(wdStory)
AppWord.Selection.Find.ClearFormatting
AppWord.Selection.Find.Replacement.ClearFormatting
With AppWord.Selection.Find
.Text = "XXX"
.Replacement.Text = ActiveCell.Value
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
AppWord.Selection.Find.Execute Replace:=wdReplaceAll
AppWord.Selection.PasteSpecial Link:=False
End Sub |
Partager