Hi Sahana,
The macro in the second post in this link does not skip abbreviations in
parentheses, but you can modify it to skip abbreviations in parentheses by
locating the following line
If Len(rlWord) > 1 Then
and additing the following lines after it
rlWord.MoveStart wdCharacter, -1
rlWord.MoveEnd wdCharacter, 1
If rlWord.Characters.First <> "(" And rlWord.Characters.Last <> ")" Then
rlWord.MoveStart wdCharacter, 1
End If
rlWord.MoveEnd wdCharacter, -1
--
Hope this helps,
Pesach Shelnitz
- Show quoted text -
Hello Sheltniz
Can same be done for this code pasted below.
I find this code more useful than the one mentioned before.
I m so sorry I m a novice. I actually don't to fit where to what. Any
help will be appreciated.
Sub TheBeforeAcronym()
Dim myRange As Range
Dim oRng As Range
Dim rslt As VbMsgBoxResult
Set myRange = ActiveDocument.Range
With myRange.Find
..Text = "<([A-Z]{2,})>"
..MatchWildcards = True
..Wrap = wdFindStop
..Forward = True
While .Execute
myRange.Select
Set oRng = myRange.Duplicate
oRng.Move wdCharacter, -5
oRng.MoveEnd wdCharacter, 4
If Not oRng.Text = "the " Then
rslt = MsgBox(Prompt:="Add 'the' before this acronym?",
Buttons:=vbYesNoCancel)
If rslt = vbCancel Then Exit Sub
If rslt = vbYes Then
Selection.InsertBefore "the "
myRange.Collapse wdCollapseEnd
End If
End If
myRange.Collapse wdCollapseEnd
Wend
End With
Set myRange = Nothing
End Sub
Thanks
Sahana