SHARE
TWEET

Untitled

Siri0n Jul 27th, 2015 (edited) 235 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub findKeywords()
  2.     Dim keywords, count As Integer, msg As String
  3.     msg = ""
  4.     keywords = Array("не более", "не менее", " или")
  5.     For Each keyword In keywords
  6.         Set myRange = ActiveDocument.Content
  7.         count = 0
  8.         With myRange.Find
  9.             .Text = keyword
  10.             Do While .Execute(Forward:=True) = True
  11.                 count = count + 1
  12.                 myRange.HighlightColorIndex = wdYellow
  13.             Loop
  14.             If count > 0 Then
  15.                 msg = msg & "'" & keyword & "' : " & count & " шт." & vbCrLf
  16.             End If
  17.         End With
  18.     Next
  19.     If msg <> "" Then
  20.         MsgBox ("Найдены ключевые слова:" & vbCrLf & vbCrLf & msg)
  21.     Else
  22.         MsgBox ("Поиск не дал результатов")
  23.     End If
  24. End Sub
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top