Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-09-2020, 05:58 AM
Userx Userx is offline Need to copy specific formated text from Word and paste from clipboard into a console application Windows 10 Need to copy specific formated text from Word and paste from clipboard into a console application Office 2019
Novice
Need to copy specific formated text from Word and paste from clipboard into a console application
 
Join Date: Oct 2020
Posts: 1
Userx is on a distinguished road
Default Need to copy specific formated text from Word and paste from clipboard into a console application

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?
Reply With Quote
Reply

Tags
cut & paste, external document, external program

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Console application inside of presentation Polly PowerPoint 0 11-11-2017 07:21 AM
Copy Text Twice to Paste into word Albundy Word 2 09-02-2016 12:59 PM
Need to copy specific formated text from Word and paste from clipboard into a console application Find & selected paras with highlighted text & copy to clipboard marceepoo Word VBA 1 09-14-2012 08:20 PM
Need to copy specific formated text from Word and paste from clipboard into a console application Mark text in a text box and copy to clipboard (with button) ArthurM PowerPoint 4 02-19-2012 11:33 AM
Need to copy specific formated text from Word and paste from clipboard into a console application paste formated text from Word to only one Excel cell heron Word 1 12-06-2005 02:37 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:33 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft