Jump to content
Macro Express Forums

Sending text to a pre-populated form field


Recommended Posts

I have a form field which is pre-populated with some content. I used "get control command" to gain access to this particular field. Here's what worries me. When I try to send some text to that filed via text type - send text directly to control, the text is placed in front of the text that was already in the filed. I tried to send <DEL> and <BACKSPACE>, and even <HOME><SHIFTDOWN><END><SHIFTUP><DEL> sequences to eliminate the old content but it doesn't work reliably (time delays are not the issue - checked it).

 

I could use the mouse (or tab through the fields) and delete the content but that's not really the approach I'd like to use. I have to populate 30 000 forms each containing 10 fileds I want to interfere with, so every second matters (the action will be repeated every month so I need an efficient and reliable solution).

 

Is there a trick to clear the field content with the use of controls?

Link to comment
Share on other sites

I have had similar problems when sending text directly to a control. In most cases, I "solve" the problem -- it's not a solution I like -- by putting focus on the field, and then sending the text via "simulating keystrokes.

 

I avoid <ShiftDown> and <ShiftUp>: I prefer a sequence like <HOME><SHIFT><END><DELETE>, which probably gives the same result, but I am superstitious of commands that simulate holding down a key...

 

Alan

Link to comment
Share on other sites

Timely thread. I tried to use Get Control and Send text directly to control yesterday for the first time in many months and sporadically got exactly the same behaviour. Whereas '0' should have been replaced by '1080', it sometimes (not always!) became '01080', or '10800'.

 

I ended up using the same method as Alan to get reliable operation, clicking in the box followed by Shift+End and then typing the new entry. I plan to return later to persist in trying the Controls approach, but this is probably a one-off and I'm impatient for a result.

 

BTW, that part was eventually reliable, but I'm now stymied by another unusual issue. I'll post separately.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

I ended up using the same method as Alan to get reliable operation, clicking in the box followed by Shift+End and then typing the new entry.

 

Mouse movements may or may not be necessary. I usually find it sufficient to give focus to the target control, without clicking it. As usual, the decision is made case by case.

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...