Bonjour,
J'utilise la macro suivant pour transformer (NPN°) en (PIECE N°), avec un formatage particulier :
Or, mes documents ont des pièces N°, 1,2, .... 12, ....20 ...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 Dim booTrouve As Boolean Selection.HomeKey unit:=wdStory Do With Selection.Find .Text = "(NPN°)" booTrouve = .Execute End With Selection.Font.Italic = True Selection.Font.Bold = True Selection.Font.Underline = True Selection.Font.Color = wdColorDarkRed Debug.Print "ok" Loop While booTrouve With Selection.Find .ClearFormatting .Text = "(NPN°)" .Replacement.ClearFormatting .Replacement.Text = "(PIECE N°)" .Execute Replace:=wdReplaceAll, Forward:=True, _ Wrap:=wdFindContinue End With
Je voudrais modifier la macro pour que le formatage/remplacement s'applique ainsi :
(NPN°1) ou (NPN°12) devienne (PIECE N°1) ou (PIECE N°12), voire (NPN°1 : contrat de travail) devienne (PIECE N°1 : contrat de travail), je pense qu'il faut utiliser des caractères spéciaux comme ?? ou ** ... mais je ne vois pas comment les intégrer ...
Si quelqu'un avait une petite idée ... ce serait hypra sympa
Merci !
Partager