Advertisement
Guest User

Untitled

a guest
Jun 11th, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub IseciTekst()
  2. '
  3. ' IseciTekst Macro
  4. '
  5. '
  6. Dim fs
  7. Dim wordLog
  8. Set fs = CreateObject("Scripting.FileSystemObject")
  9. Set wordLog = fs.CreateTextFile("c:\testfile.txt", True, True)
  10. Dim rngstory As Word.Range
  11. Set rngstory = ActiveDocument.Range
  12. With rngstory.Find
  13. .ClearFormatting
  14. .Replacement.ClearFormatting
  15. .MatchWildcards = False
  16. .MatchWholeWord = False
  17. .Wrap = wdFindStop
  18. .Highlight = True
  19. While .Execute
  20. If rngstory.HighlightColorIndex = wdGreen Then
  21. wordLog.WriteLine rngstory
  22. End If
  23. Wend
  24. End With
  25. wordLog.Close
  26.  
  27. Set objShell = CreateObject("WScript.Shell")
  28. Result = objShell.Run("c:\TxtReForm.exe" & " " & emailInput, 0, True)
  29. Set objShell = Nothing
  30.  
  31. Set wrd = GetObject(, "Word.Application")
  32. wrd.Visible = True
  33. wrd.Documents.Open "c:\testfile2.txt"
  34. Set wrd = Nothing
  35. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement