Jump to content
Macro Express Forums

Capture Values From Fields In Custom Windows Application


tdelios

Recommended Posts

hi all..

 

I am running a custom made program that a programmer made for us that has a bunch of input box fields that dispaly values from a database search.

 

Can someone give me a sample script on how I can set focus to the custom made application, have it go into the first inbox box field that contains information, copies it to a memory variable, and continues to jump from input box field to input box field capturing the values in each nad putting them in their own memory variables.

 

thank you.

 

Tom

Link to comment
Share on other sites

Without using the custom application, it is hard to say for sure, but if it uses standard Windows protocols, you should be able to tab from field to field using the Text Type command. Once you have moved to the new field, you can copy the contents to the clipboard and then set a variable from the clipboard.

Link to comment
Share on other sites

You might also try using controls but the tab solution might be easier if you're unfamiliar with controls. But ISS has a nice tutorial on controls using MS Calculator if you're interested in learning.

Link to comment
Share on other sites

You might also try using controls but the tab solution might be easier if you're unfamiliar with controls. But ISS has a nice tutorial on controls using MS Calculator if you're interested in learning.

 

I have done it both ways. Tab to field, copy to clipboard, store clipboard in variable for later use, repeat for each field. The gotcha here is to make sure you are on the right field to begin with, which may take a little experimenting with what scripted keystrokes will reliably get you there.

 

The better method IMHO is to use Get Control, which you have to set up manually for each field on the form, and when the macro runs the information about each control is stored in variables C1, C2, etc. Then to capture the data entered by the user (or displayed by the program), you do Variable Get Control Text to retrieve the data into text variables. This has several advantages: (1) data capture works even if the field is grayed out and/or you can't tab to it, (2) data capture seems to me to be faster, (3) data capture does not affect (or rely upon) where the user has left the cursor, so it is potentially less disruptive to the user. Definitely worth your effort to go through the controls tutorial mentioned above.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...