You are here:

VB Script/Set Cursor Position

Advertisement


Question
Cursor Position
Cursor Position  
QUESTION: Hello. I am operating ISeries Access for Windows and I need
some vbscript to set the cursor to specific coordinates on
my screen when the script is ran. In this case, the
coordinates are 04/052. Thank you in advance.

ANSWER: Jesse,

Sorry for late reply, here is your code:

Copy this single line code and Paste to your General declarations:

Private Declare Sub SetCursorPos Lib "User32" (ByVal X As Long, ByVal Y As Long)

After that use this line where ever you want

SetCursorPos 4, 52

Subbu.

---------- FOLLOW-UP ----------

QUESTION: Thanks for the reply.
I'm a novice with vbscript, so I am having trouble
implementing your code. The code I have copies a text
string once I can get it to the position. Consider it the
second half of the code. Please help. Here's what I have:

[PCOMM SCRIPT HEADER]
LANGUAGE=VBSCRIPT
DESCRIPTION=
[PCOMM SCRIPT SOURCE]
autECLSession.SetConnectionByName(ThisSessionName)
REM This line calls the macro subroutine
subSub1_

sub subSub1_()
  autECLSession.autECLOIA.WaitForAppAvailable
  autECLMacro "[edit-copy]"

end sub




ANSWER: Jessie,

Did you find General declaration in your Visual Basic editor?

If Not,
what is your operating system?
Where you are writing this visual basic code?
How you are running this code?



---------- FOLLOW-UP ----------

Script View
Script View  
QUESTION: No I didn't find where to enter General Declaration. This
probably has been my problem as I have seen other codes
that might work but can't get them to work for me. I work
with Windows Xp and am running Iseries Access for Windows
and inputting the script in their macro/script editor. See
attached image.

Answer
The inner window in your Image not clearly visible.

Set focus on inner window and Hold Alt key then press PrintScreen button to get big Image.

I dont have any knowledge on Iseries.

If you find how to load any dll to your Macro editor then problem will be solved.  Give a try.

Thanks
Subbu.

VB Script

All Answers


Answers by Expert:


Ask Experts

Volunteer


Subbu

Expertise

I can answer VB Script questions which are related to Visual Basic / VBA / QTP Scripts.

Experience

8 Years

Education/Credentials
Master of Computer Applications

Awards and Honors
Established Member from QA Forums and Brainbench certification

©2012 About.com, a part of The New York Times Company. All rights reserved.