Prikazi cijelu temu 12.08.2014-21:17
zxz Online
Administrator
Registrovan/a od: 03.02.2009-16:22
Lokacija: Tuzla


Subject: Re: Zamena reci u Word-u?
Evo ti kod.
Postupak postavljenja je isti kao u predhodnom tvom postu.
DownloadIzvorni kod (Visual Basic):
  1. Sub Zamijeni()
  2. '
  3. ' Rijeci Macro
  4. ' Macro created 12-8-2014 by nn
  5. '
  6. Dim Dok As Document
  7. Dim Temp As String, ArRijeci() As String, ArRed() As String
  8. Dim I As Integer
  9. Dim Str As String
  10.  
  11. Set Dok = ActiveDocument
  12. Temp = Dok.ActiveWindow.Selection
  13. ArRijeci = Split(Temp, vbCr)
  14. For I = LBound(ArRijeci) To UBound(ArRijeci) - 1
  15. ArRed = Split(ArRijeci(I), "-")
  16. Str = Str & ArRed(1) & "-" & ArRed(0) & vbNewLine
  17. Next I
  18. Selection.TypeText (Str)
  19. End Sub

Pozdrav