Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub TwardaSpacja()
- Dim i As Long
- Dim licznik_zmian As Long
- licznik_zmian = 0
- maxlines = ActiveDocument.BuiltInDocumentProperties(wdPropertyLines)
- For i = 1 To maxlines
- DoEvents
- Selection.GoTo What:=wdGoToLine, Which:=wdGoToFirst, Count:=i, Name:=""
- Selection.EndKey Unit:=wdLine, Extend:=wdExtend
- With Selection.Characters
- If .Count > 4 Then
- If (.Item(.Count - 2) == Chr(32)) _
- And (.Item(.Count - 1) >= Chr(65) And .Item(.Count - 1) <= Chr(90) Or .Item(.Count - 1) >= Chr(97) And .Item(.Count - 1) <= Chr(122)) _
- And (.Item(.Count) = Chr(32)) Then
- .Item(.Count) = Chr(160)
- licznik_zmian = licznik_zmian + 1
- End If
- End If
- End With
- Next
- Selection.HomeKey Unit:=wdStory
- MsgBox "Zrobione" & Chr(13) & _
- "Dokonano " & licznik_zmian & " zmian/y", vbInformation
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment