Re: Question about VB scripting
- From: "Paul Randall" <paulr901@xxxxxxxxxxxx>
- Date: Fri, 14 Dec 2007 12:12:50 -0700
"Rogelio" <Rogelio@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:92DC049A-D122-488A-B0A6-057F5290281C@xxxxxxxxxxxxxxxx
hey, I'm going to be working with a program called "CRT", it uses
VBS to do
some scripting.
I'm a .NET developer, namely C#, but I want to learn VBA to see if I
can
make a program for someone.
what this program needs to do is highlight a certain field of data
in this
application, copy it, open notepad, and paste it there. is this
possible on
the realm of VB Script? can VB Script open a different app and paste
it?
can someone point me in the right direction here?
Note that VBA and VBS are both based on Visual Basic, but are as
different as goats, cows, and moose.
I know nothing of your CRT program. It's scripting capabilitys could
be very similar to plain VBScript, or it could be quite different.
Programs that incorporate VBScripting capabilities typically include
VBS extensions or objects to interact with their program in ways plain
VBS can not. For example, VBScript has no commands to interact with
the clipboard, but recent versions of the Internet Explorer object
includes methods to copy a selection to the clipboard. Notepad has no
scripting interface, so VBScript can't directly paste from the
clipboard into Notepad. VBScript can access a shell object which has
a sendkeys method which can manipulate Notepad's menus to make a paste
occur, but sendkeys can be unreliable. A free COM object called
AutoIt can much more reliably send keystrokes (and mouse clicks) to
any desired open window, include Notepad.
So you need to read the docs to see how the built-in VBS can find and
select the desired text, and copy it to the clipboard. It is easy to
start Notepad with VBScript, using the shell object. Then you have to
decide what method to use to position the cursor and cause Notepad's
paste function to occur.
-Paul Randall
.
- Prev by Date: Re: Question about VB scripting
- Next by Date: Re: Question about VB scripting
- Previous by thread: Re: Question about VB scripting
- Next by thread: Re: Question about VB scripting
- Index(es):
Relevant Pages
|