Re: Question about VB scripting

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"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


.



Relevant Pages

  • Re: Is there anywhere a "cook book" ?
    ... I think that a big part of the difficulty is that learning VBScript ... Part of the reason for the lack of structure is that VBS was first ... because scripting was for browsers and browsers shouldn't access ... Much of their documentation is really a blend of technical ...
    (microsoft.public.scripting.vbscript)
  • Re: What to code in now that VS2008 has depreciated VBScript?
    ... I don't expect it to go away until we get to the OS release that removes cmd.exe and notepad. ... I don't know if MS has any plans to get rid of VBScript, but my guess is that it won't be any time soon.... ... greatbarrier86 wrote: ... when scripting since VS2k8 no longer "supports" VBScript? ...
    (microsoft.public.scripting.vbscript)
  • Re: Net Send to computer
    ... > the command prompt. ... > Using vbs: ... There is nothing builtin for this in VBScript, ... Microsoft MVP Scripting and WMI, ...
    (microsoft.public.windows.server.scripting)
  • Re: Need help with this vbs script
    ... I get errors running it as a vbs. ... That is not a VBScript that you can put in a .vbs file, it is VB code, ... torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.windowsxp.general)
  • Re: Disabling FW via script
    ... I have tried the registry edits ... This VBScript creates the registry values that disables the ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.windowsxp.general)