Hi,
Sorry Sorry sorry for my english
For my dissertation today at more than 400 pages, I would like to change the style and box of certain words. I found my happiness ... well almost.
In the example below, I need to modify "DESCRIPTION" in one style and "-- remplissage" in another style
This is my macro :
Code:
Sub change ()
Application.ScreenUpdating = False
Selection.HomeKey Unit:=wdStory
Do
With Selection.Find
.ClearFormatting
.Text = "COORDINATION"
.MatchWholeWord = True
.Font.Bold = False
.Font.Underline = True
.Style = "Souligné"
.MatchCase = True
.Wrap = wdFindStop
.Execute
End With
If Selection.Find.Found Then
Selection.Style = ActiveDocument.Styles("NORMAL_01")
Selection.Range.Case = wdUpperCase
End If
Loop Until Not Selection.Find.Found
End Sub
It's good except that it changes ALL the words "description" and I only want if this one is in capitals or if this one is at the beginning of a sentence
EX :
DESCRIPTION
(yes)
This is a description
(NO) de my car ...
Thanks in advance and sorry for my english