Sub citationInAbstract()
Dim j, k As Integer
k = 0
arr = "Table,Figure,Equation,www.,\[[0-9-\\–]+?\] "
findT = Split(arr, ",")
Selection.HomeKey wdStory
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Wrap = wdFindStop
.MatchWildcards = False
.Forward = True
.Text = "Abstract"
.Font.Bold = True
.Replacement.Text = ""
.Execute
If .Found Then
Selection.Paragraphs(1).Range.Select
For i = 0 To UBound(findT)
j = 0
Dim reg As New RegExp
With reg
.Global = True
.Pattern = findT(i)
Set matches = .Execute(Selection.Text)
If .test(Selection.Text) = True Then
For Each m In matches
myL = m.firstindex
Dim myrange As Range
Set myrange = ActiveDocument.Range(Selection.Start + myL + k, Selection.Start + myL + Len(m) + k)
myrange.HighlightColorIndex = wdYellow
If j = 0 Then
myrange.comments.Add myrange, "Citation is't allowed"
k = k + 1
End If
j = j + 1
Next
End If
End With
Next
Else
ActiveDocument.Paragraphs(1).Range.comments.Add ActiveDocument.Paragraphs(1).Range, "can't find abstract"
End If
End With
End Sub