shit_code

Untitled

Oct 10th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. Sub Stat()
  2. '  òåêñòå âûäåëèòü öâåòîì è ïîäñ÷èòàòü ñëîâà ñîäåð. íå ìåíåå äâóõ ïîâòîð. áóêâ
  3. Dim oWord As Object, s, i, j
  4. On Error GoTo err_col
  5. For Each oWord In ActiveDocument.Range.Words
  6.    With New Collection
  7.        s = Trim(Replace(oWord.Text, Chr(160), ""))
  8.        For i = 1 To Len(s)
  9.            .Add 0, Mid(s, i, 1)
  10.        Next
  11. next_word:
  12.    End With
  13. Next
  14. With ActiveDocument
  15.    .Range.InsertParagraphAfter
  16.    If (j < 1) Then j = 0
  17.  .Range.InsertAfter "Ñëîâ ñ ïîâ. áóêâàìè: " & j
  18.    With .Paragraphs(.Paragraphs.Count).Range.Font
  19.        .Size = 18
  20.    End With
  21. End With
  22. Exit Sub
  23.  
  24. err_col:        ' ïðîïóñê ïðîáåëà
  25. ActiveDocument.Range(oWord.Start, oWord.End + (Right(oWord.Text, 1) = " ")) _
  26.     .HighlightColorIndex = wdYellow
  27. j = j + 1
  28. Resume next_word
  29. End Sub
  30. выделить цветов и подсч слов содерж не менее двух повтор букв
Add Comment
Please, Sign In to add comment