Hi. The code below replaces "AAA" with "BBB" in the document.
How can I avoid replacing "aaa" with "BBB"?
I have tried Option Compare Binary but without results. I could not check for lowercase inside the With either.
****************************************************
findx = "AAA"
replacex = "BBB"
Dim rngStory As Range
For Each rngStory In ActiveDocument.StoryRanges
With rngStory.Find
.Text = findx
.Replacement.Text = replacex
.Wrap = wdFindContinue
.Execute Replace:=wdReplaceAll
End With
Next rngStory
****************************************************
How can I avoid replacing "aaa" with "BBB"?
I have tried Option Compare Binary but without results. I could not check for lowercase inside the With either.
****************************************************
findx = "AAA"
replacex = "BBB"
Dim rngStory As Range
For Each rngStory In ActiveDocument.StoryRanges
With rngStory.Find
.Text = findx
.Replacement.Text = replacex
.Wrap = wdFindContinue
.Execute Replace:=wdReplaceAll
End With
Next rngStory
****************************************************