I need to copy lines of text based on the color of the characters, one paragraph at a time. Then I need to paste these lines or group of lines into an external program using VBA macro in Word.
I have this VBA code that I have been experimenting with that pipes the lines to the application via StdIn/StdOut but it doesn't seem very reliable and its not user friendly.
Code:
Sub AutoMop()
'
' AutoMop Macro
'
'
Set wShell = VBA.CreateObject("WScript.Shell")
Set oExec = wShell.Exec("C:\Users\lxpot\Coriant\7191CS\PuTTY\plink.exe aaTest -pw user.778")
' Write to the input stream
oExec.StdIn.Write "service ssh status" & vbCrLf
' The output stream can be shown to the user, e.g.
sOutput = oExec.StdOut.Readall()
MsgBox (sOutput)
As you can see I am able to start an external program and send commands. Now I just need to copy and paste. Any suggestion of examples of what I can do?