# Solved: Need a program to automatically paste from clipboard into Word if clipboard c



## HowdeeDoodee (Aug 26, 2004)

I need a program, macro, or whatever to automatically paste the contents of the clipboard into MS Word if anything is added to the clipboard. I am copying material at the rate of one clip per second from a non-microsoft document and would like that material automatically inserted from the clipboard into a Word document appearing on the task bar.

Thank you in advance for any replies.


----------



## Ziggy1 (Jun 18, 2002)

can I suggest this free program,,, GADWIN then you press the print screen button is saves the screen shot automatically to a folder you specify and numbers it in sequence.

The default settings will let you view the image, but you can change the settings so you don't see any options just press the button continously and it saves them. You can choose to draw a rectangle around the area or active window ,client window etc...very cool for a free program.

* it's not a trial either and there are no watermarks on the shots...but there are 2 choices so make sure it says "freeware" not the professional"

* the rectangle option is good for word because cropping in word does not reduce file size

* change output settings to JPG from BMP

* before you say this is not good for you here's a tip...after you take your shots you can got to the folder and drag your images(select a range) right onto the word document and it will import them automatically.

http://www.gadwin.com/download/


----------



## HowdeeDoodee (Aug 26, 2004)

Thank you for the suggestion. I am copying and pasting rich text, not pictures or graphics. I am copying one page per second. I need a program to automatically paste into Word without my doing anything like pushing a button. Since this is an ongoing project, it is expected a million pages would be copied and then pasted. Thank you again for the suggestion.


----------



## Ziggy1 (Jun 18, 2002)

Ok, I saw the word "clip" in your request...

So are you selectively choosing parts of a document or copying the entire text in the document? The issue will be that Word has to be Actively selected to Paste to it, since the clipboard can be used through out all applications.

I think one method might be to open in Word and delete what you Don't want...then have a macro that will append to a main word document..I'll take a look at it if that can work for you.

1.Open file
2. Edit
3. Run Macro to Append
4. Clear document for next file


----------



## HowdeeDoodee (Aug 26, 2004)

Thank you for the response. I am copying each page of an electronic public domain text that is not in MS Word format. The electronic book is sitting to the left side of the screen and the Word document is sitting on the right side of the screen.

In the electronic book, I am copying each page by selecting the whole page (Ctrl +A) then copying the whole page (ctrl+C) thus I am putting the whole page in the clipboard. Then, I move the cursor over to the Word document and paste each copied page at the end of the Word document. Doing this by hand is not feasible because of the number of pages and the number of books to be processed. The electronic book is not in a format where I can copy the whole book. I have to copy each page of the electronic book, one page at a time.

I have tried to develop a routine using AutoHotkey, Clipboard Helper, Ditto, and some others but there is always a snag. If I could find it, I would like a clipboard utility that will retain rtf format in one file rather than in a database. All of the clipboard utilities I have reviewed do not keep the clips from the clipboard in a single flat file unless only text is stored without the rtf. I need to keep the rtf format in the material that is pasted into the Word document.

Thank you again for your responses. I appreciate your effort.


----------



## HowdeeDoodee (Aug 26, 2004)

I don't need to make any deletions. All I need to do is copy and paste.


----------



## Ziggy1 (Jun 18, 2002)

here are some links...if you have Firefox the autocopy saves a few keystrokes, maybe the other link helps also...see further down if the "powertoys" option mentioned can be of any use.

https://addons.mozilla.org/en-US/firefox/addon/383

http://lifehacker.com/software/feat...your-mouse-with-true-x+mouse-gizmo-294701.php


----------



## HowdeeDoodee (Aug 26, 2004)

Thank you for the links. However, they do not apply in this instance because the activity is not related to web pages or web page design. Thank you again.


----------



## webarchitect (May 12, 2008)

Well if this is purely text, without any formatting or images, then maybe you can use a macro to copy all the text immediately from your browser and save it under a specific filename. I had a similar problem before, and I used iMacros extension for firefox to gather text from a specific website and save it on my desktop. I then just append all the files together in a specific format before saving in a Word Doc.


----------



## Ziggy1 (Jun 18, 2002)

I guess I'm not quite "getting" what your source data "is", what is the file extension...I figured when you said electronic book it would still be a file format that is readable by a browser or even Word, with links to navigate the pages?


----------



## HowdeeDoodee (Aug 26, 2004)

> Well if this is purely text, without any formatting or images, then maybe you can use a macro to copy all the text immediately from your browser and save it under a specific filename. I had a similar problem before, and I used iMacros extension for firefox to gather text from a specific website and save it on my desktop. I then just append all the files together in a specific format before saving in a Word Doc.


Thank you for the response. Just to clarify, I am not working in a browser in this project. The two pieces of software noted above are e-Sword (a Bible software application that displays public domain books) and MS Word. I must maintain an rtf format because the e-books displayed contain Greek and Hebrew alphabet characters. To do this project I do a "select all" and then a "copy" in e-Sword and then a "paste" in Word. I keep repeating this process for each page in the e-book. I am trying to develop a macro using AutoHotkey but I am having issues with the final steps in the process. With AutoHotkey I can do loops which repeats the process forever. I cannot do a standard append with a program like TextCollect because with TextCollect, all the files have to be in .txt format, which erases the Greek and Hebrew characters seen in an rtf document. Supposedly, there are issues in appending Word files because of the header info. Thank you again for the response.


----------



## HowdeeDoodee (Aug 26, 2004)

> I guess I'm not quite "getting" what your source data "is", what is the file extension...I figured when you said electronic book it would still be a file format that is readable by a browser or even Word, with links to navigate the pages?


Thank you, Ziggy for the response. As I noted in the post just made above, the software is e-Sword. I do not have access to the file or file extension. The file format is readable only by e-Sword, which is why I am selecting and copying in e-Sword then going over and pasting in Word. I am not using a browser in any regard. Thank you for the input.


----------



## stantley (May 22, 2005)

Hi HowdeeDoodee.

So what's the snag you hit with the AutoHotkey script? It's sounds like you're pretty close to having it working.


----------



## HowdeeDoodee (Aug 26, 2004)

Hi Stantley, thank you for asking. Check back in about an hour and I will try to have a cogent response.

Jimmy Hendrix? You must be older than me. I'm older than dirt anyway...


----------



## HowdeeDoodee (Aug 26, 2004)

OK, here we go. I recorded the following script. I have recorded others but they did not finish the recorded execution as expected. The problem seems to be changing focus from MS Word to e-Sword back to MS Word.

I have e-Sword set up on the left 3/4's of my screen with MS Word set up on the right 1/4th of my screen.

In the routine below, I start out with the focus on MS Word. I click the mouse on the MSWord title bar to make sure the Word app is activated. I type in at the bottom of the Word doc a line of x's to use as a separator line. Then I go over to e-Sword and go through the steps below. Then I go back to MS Word to finish by pasting the clipboard contents into MS Word. Everything works as expected during the recording process.

However...

When I go to "reload this script" in Hotkeys, I get an error message pointing to the third line, saying "WinWait,,". If I take out all the WinWait lines the script goes through most of the steps but does not finish up by activating the MS Word app and pasting the copied material from the clipboard.

I think there may be an issue with how the position of the mouse cursor is recorded. The numbers do not look right according to the way I have the screen set up.

When I click on the top of the title bar in Word at the beginning of the script here is what was recorded.
At the top of the following script you see MouseClick, left, 658, 4

When I click on the top of the title bar in Word near the end of the script here is what was recorded.
At the bottom of the screen you see MouseClick, left, 42, 8
The thing is...I clicked the mouse in the same general position both times but got vastly different numbers.

When I get the script to work, I want to add a loop statement at the top of the script to run the script any number of times.

Thank you in advance for the help.

Here is the recorded script.


```
^1::
{
WinWait, , 
IfWinNotActive, , , WinActivate, , 
WinWaitActive, , 
MouseClick, left,  658,  4
Sleep, 100
WinWait, Document3 - Microsoft Word, 
IfWinNotActive, Document3 - Microsoft Word, , WinActivate, Document3 - Microsoft Word, 
WinWaitActive, Document3 - Microsoft Word, 
Send, xxxxxxxxxxxxxxxxxxxxxxxxxxxxx{ENTER}{ENTER}
WinWait, e-Sword - the Sword of the LORD with an electronic edge, 
IfWinNotActive, e-Sword - the Sword of the LORD with an electronic edge, , WinActivate, e-Sword - the Sword of the LORD with an electronic edge, 
WinWaitActive, e-Sword - the Sword of the LORD with an electronic edge, 
MouseClick, left,  82,  100
Sleep, 100
MouseClick, left,  102,  99
Sleep, 100
MouseClick, left,  237,  102
Sleep, 100
WinWait, Document3 - Microsoft Word, 
IfWinNotActive, Document3 - Microsoft Word, , WinActivate, Document3 - Microsoft Word, 
WinWaitActive, Document3 - Microsoft Word, 
MouseClick, left,  42,  8
Sleep, 100
Send, {CTRLDOWN}{SHIFTDOWN}{END}{SHIFTUP}{CTRLUP}{DOWN}{CTRLDOWN}v{CTRLUP}{ENTER}
}
Return
```
Thanks in advance.


----------



## stantley (May 22, 2005)

The WinActivate should put the focus on that window, so there's no need to do a mouse click on the title bar. Another thing is I don't record a script because it sometimes writes some goofy code, I just write the code from scratch. Try something like this:

^1::
{

WinActivate, e-Sword - the Sword of the LORD with an electronic edge, 
WinWaitActive, e-Sword - the Sword of the LORD with an electronic edge 

Send, {Ctrl Down}a{Ctrl Up}
Send, {Ctrl Down}c{Ctrl Up}

;I guess this is sort of what those mouse clicks are doing

WinActivate, Document3 - Microsoft Word
WinWaitActive, Document3 - Microsoft Word 

Send, xxxxxxxxxxxxxxxxxxxxxxxxxxxxx{ENTER}{ENTER}
Send, {Ctrl Down}v{Ctrl Up}

}
Return

To find the coordinates of the mouse clicks, right-click on the H icon > Window Spy.

Then go to the screen you're working on, put the cursor where you want it and write down the x,y coordinates under Mouse Position 'In Active Window'. Then put those numbers in the code. To test it out you can do a MouseMove to make sure it's going to the right place and then change it to a MouseClick.


----------



## HowdeeDoodee (Aug 26, 2004)

Thanks Stantley. I really appreciate the help.

I changed some things around in the original script I posted and things seem to be working. As you can see I integrated some of your suggestions. I have to use the recorder because I do not remember enough of the code from the old days. So far, I have had reliable results with the following. If I get goofy stuff happening I will revise according to your code suggestions. Thank you for the help. Your work is appreciated.

Here is the code that is working at the moment.


```
^1::
Loop 5
{
WinWait, Document3 - Microsoft Word, 
IfWinNotActive, , , WinActivate, , 
WinWaitActive,  Document3 - Microsoft Word, 
MouseClick, left,  658,  4
Sleep, 200
WinWait, Document3 - Microsoft Word, 
Sleep, 200
IfWinNotActive, Document3 - Microsoft Word, , WinActivate, Document3 - Microsoft Word, 
Sleep, 200
WinWaitActive, Document3 - Microsoft Word, 
Sleep, 200
Send, xxxxxxxxxxxxxxxxxxxxxxxxxxxxx{ENTER}{ENTER}
WinWait, e-Sword - the Sword of the LORD with an electronic edge, 
Sleep, 200
IfWinNotActive, e-Sword - the Sword of the LORD with an electronic edge, , WinActivate, e-Sword - the Sword of the LORD with an electronic edge, 
Sleep, 200
WinWaitActive, e-Sword - the Sword of the LORD with an electronic edge, 
Sleep, 200
MouseClick, left,  82,  100
Sleep, 200
MouseClick, left,  102,  99
Sleep, 200
MouseClick, left,  237,  102
Sleep, 200
WinWait, Document3 - Microsoft Word, 
Sleep, 200
IfWinNotActive, Document3 - Microsoft Word, , WinActivate, Document3 - Microsoft Word, 
Sleep, 200
WinWaitActive, Document3 - Microsoft Word, 
Sleep, 200
Send, {CTRLDOWN}{SHIFTDOWN}{END}{SHIFTUP}{CTRLUP}{DOWN}{CTRLDOWN}v{CTRLUP}{ENTER}
}
Return
```


----------



## slurpee55 (Oct 20, 2004)

HowdeeDoodee said:


> Thank you, Ziggy for the response. As I noted in the post just made above, the software is e-Sword. I do not have access to the file or file extension. The file format is readable only by e-Sword, which is why I am selecting and copying in e-Sword then going over and pasting in Word. I am not using a browser in any regard. Thank you for the input.


Just for your edification, here are the file extensions for e-Sword (about halfway down the page)
http://www.davidcox.com.mx/e-swordmodules/Install_modules.htm :up:


----------



## slurpee55 (Oct 20, 2004)

Also, at the bottom of the page here
http://www.e-sword.net/extras.html
are some macros you may find useful - it says there:
"If you use Microsoft Word for your sermon preparation (instead of the really cool Topic Notes editor in e-Sword), then maybe the following template will make searching and inserting Scripture easier for you. Taking advantage of the latest in Active-X technology these e-Sword macros give you all of the capability of e-Sword's Search and Copy functions. Now there is no reason to switch back and forth between applications, and "cut-and-paste". "


----------



## Ziggy1 (Jun 18, 2002)

Hey Slurpee...next time try to show up at the begining of the Post LOL.....good for you for digging up that info :up:


----------



## slurpee55 (Oct 20, 2004)

Sorry Zig, was out wandering the universe....


----------

