Hello
Two questions:
1. I need a simple script to copy a defined text that is set within the
script to the clipboard.
2. What is the best book or source to begin learning vbs. Is there a
perferred book? Needs to start at the beginning and be a simple as
possible for starters.
Thanks in advance.

Re: Script to copy text to clipboard by McKirahan

McKirahan
Sat Nov 05 14:41:13 CST 2005

"Jawdoc" <drbrooks@msoms.com> wrote in message
news:Nx7bf.420$kd.25@bignews4.bellsouth.net...
> Hello
> Two questions:
> 1. I need a simple script to copy a defined text that is set within the
> script to the clipboard.

How is the text "defined".

Below is a VBScript that sets and gets clipboard data.

> 2. What is the best book or source to begin learning vbs. Is there a
> perferred book? Needs to start at the beginning and be a simple as
> possible for starters.

http://www.w3schools.com/vbscript/

> Thanks in advance.


Option Explicit
'*
Const cTXT = "Some text."
'*
'* Set Clipboard Data
'*
Dim objIEA
Set objIEA = CreateObject("InternetExplorer.Application")
objIEA.Navigate "about:blank"
Do Until objIEA.ReadyState=4: WScript.Sleep 1: Loop
objIEA.Document.ParentWindow.ClipboardData.SetData "Text", cTXT
objIEA.Quit
Set objIEA = Nothing
'*
'* Get Clipboard Data
'*
Dim objHTM
Set objHTM = CreateObject("htmlfile")
WScript.Echo objHTM.ParentWindow.ClipboardData.GetData("text")
Set objHTM = Nothing



Re: Script to copy text to clipboard by Jawdoc

Jawdoc
Sat Nov 05 15:05:21 CST 2005

McKirahan wrote:
> "Jawdoc" <drbrooks@msoms.com> wrote in message
> news:Nx7bf.420$kd.25@bignews4.bellsouth.net...
>
>>Hello
>>Two questions:
>>1. I need a simple script to copy a defined text that is set within the
>>script to the clipboard.
>
>
> How is the text "defined".
>
> Below is a VBScript that sets and gets clipboard data.
>
>
>>2. What is the best book or source to begin learning vbs. Is there a
>>perferred book? Needs to start at the beginning and be a simple as
>>possible for starters.
>
>
> http://www.w3schools.com/vbscript/
>
>
>>Thanks in advance.
>
>
>
> Option Explicit
> '*
> Const cTXT = "Some text."
> '*
> '* Set Clipboard Data
> '*
> Dim objIEA
> Set objIEA = CreateObject("InternetExplorer.Application")
> objIEA.Navigate "about:blank"
> Do Until objIEA.ReadyState=4: WScript.Sleep 1: Loop
> objIEA.Document.ParentWindow.ClipboardData.SetData "Text", cTXT
> objIEA.Quit
> Set objIEA = Nothing
> '*
> '* Get Clipboard Data
> '*
> Dim objHTM
> Set objHTM = CreateObject("htmlfile")
> WScript.Echo objHTM.ParentWindow.ClipboardData.GetData("text")
> Set objHTM = Nothing
>
>
That did it. Thanks
How can I change the Name in the Title Bar (Now "Windows Script Hosts")
And can I change the text that is displayed on the pop up not to
necessarily reflect the clipboard contents.
Thanks again!
Sorry to be picky on this.


Re: Script to copy text to clipboard by mr_unreliable

mr_unreliable
Sat Nov 05 19:45:44 CST 2005

hi Jawdoc,

You may find that the autoItX control is a little more
"lite weight" than Internet Explorer.

--- <snip> ---
Set oAutoIt = CreateObject("AutoItX3.Control")
oAutoIt.ClipPut "This text is now placed in your clipboard"
--- </snip> ---

AutoItX may be found here:

http://www.autoitscript.com/autoit3/downloads.php

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)

Jawdoc wrote:
> Hello
> Two questions:
> 1. I need a simple script to copy a defined text that is set within the
> script to the clipboard.
> 2. What is the best book or source to begin learning vbs. Is there a
> perferred book? Needs to start at the beginning and be a simple as
> possible for starters.
> Thanks in advance.

Re: Script to copy text to clipboard by McKirahan

McKirahan
Sun Nov 06 09:59:25 CST 2005

"Jawdoc" <drbrooks@msoms.com> wrote in message
news:l89bf.428$kd.133@bignews4.bellsouth.net...

[snip]


> That did it. Thanks

You're welcome.

> How can I change the Name in the Title Bar (Now "Windows Script Hosts")

Use "MsgBox" instead of "WScript.Echo"

> And can I change the text that is displayed on the pop up not to
> necessarily reflect the clipboard contents.

What do you want to display?

Change
WScript.Echo objHTM.ParentWindow.ClipboardData.GetData("text")
to
MsgBox "Your message",vbInformation,"Your title"

> Thanks again!
> Sorry to be picky on this.
>



Re: Script to copy text to clipboard by mayayana

mayayana
Sun Nov 06 10:36:22 CST 2005



Is this code specific to IE6? Similar samples
get posted periodically, but they never work
for me, with IE 5.00. I also don't get any error.
I just get no text sent to the clipboard.

>
> Option Explicit
> '*
> Const cTXT = "Some text."
> '*> '*
> Dim objIEA
> Set objIEA = CreateObject("InternetExplorer.Application")
> objIEA.Navigate "about:blank"
> Do Until objIEA.ReadyState=4: WScript.Sleep 1: Loop
> objIEA.Document.ParentWindow.ClipboardData.SetData "Text", cTXT
> '* Set Clipboard Data

> objIEA.Quit
> Set objIEA = Nothing
> '*
> '* Get Clipboard Data
> '*
> Dim objHTM
> Set objHTM = CreateObject("htmlfile")
> WScript.Echo objHTM.ParentWindow.ClipboardData.GetData("text")
> Set objHTM = Nothing
>
>



Re: Script to copy text to clipboard by McKirahan

McKirahan
Sun Nov 06 12:22:08 CST 2005

"mayayana" <mayayanaXX1a@mindXXspring.com> wrote in message
news:aiqbf.4930$2y.1900@newsread2.news.atl.earthlink.net...
>
>
> Is this code specific to IE6? Similar samples
> get posted periodically, but they never work
> for me, with IE 5.00. I also don't get any error.
> I just get no text sent to the clipboard.
>

It works under IE5.5.

This link says it should work under IE5.0:
http://my.fcc.net/~tglbatch/Clipboard.vbs.txt



Re: Script to copy text to clipboard by mayayana

mayayana
Sun Nov 06 13:05:10 CST 2005

> > Is this code specific to IE6? Similar samples
> > get posted periodically, but they never work
> > for me, with IE 5.00. I also don't get any error.
> > I just get no text sent to the clipboard.
> >
>
> It works under IE5.5.
>
> This link says it should work under IE5.0:
> http://my.fcc.net/~tglbatch/Clipboard.vbs.txt
>
I just tried it again to make sure, but no luck.
Maybe it's actually v. 5.01 that's required. (The
Win2000 version rather than the 98SE version).
I don't know exactly what changed in 5.01, but
based on the various patch reports from MS over
the years - and also based on IE requirements
for various things - there seem to have been some
fundamental changes that were brought in with
5.01 that didn't exist in 5.00 or earlier.



Re: Script to copy text to clipboard by Fosco

Fosco
Sun Nov 06 23:29:12 CST 2005

"McKirahan"
> It works under IE5.5.

If you have HIGH internet protection settings it does not

--
Fosco