background process to monitor cursor location



This is a followup question from a previously answered thread:
"clicking in protected forms: MS knowledge base article ID: 839950" from
March 26, 2008

The problem is:
In summary, the user must click or tab from one form field into another
form
field on a protected document or Word does not run the form field's 'on
entry' and 'on exit' macros.

My solution:
Inside the Document_Open() subroutine, I am using the Timer and DoEvents
functions in a While Loop to 'wait and watch' what the user is doing.

When the cursor is 'properly' placed or 'improperly' found on one of the
text form fields used for data entry, then a pointer to that field is stored.
If the focus is moved 'properly' to another form field, the pointer is set
to the new field. However, if/when the cursor is 'improperly' found in some
other location, the validation routine is run and the pointer is reset (or
set to the new data entry field).

Finally, I am using the Document_Close() subroutine to set a flag that
allows Word to kick out of the While Loop and exit the Document_Open()
subroutine.

My concern/question:
Practically this appears to be working, although it makes the response
sluggish (especially if focus is moved to a different Word Document).

However, there is so much in this Windows world that I don't know and I am
concerned that I have opened a 'pandora's box'. Does anyone see any danger
in using this methodology or have any other advice?

Thank you!

--
James III,
Sincere VBA Newbie!
.



Relevant Pages

  • Re: background process to monitor cursor location
    ... Inside the Document_Opensubroutine, I am using the Timer and DoEvents ... text form fields used for data entry, then a pointer to that field is stored. ... If the focus is moved 'properly' to another form field, ...
    (microsoft.public.word.vba.general)
  • Re: Procedure Pointer (Components) with no explicit interface and with implicit typing
    ... in principle, I can assign to it either a function nor a subroutine, e.g. ... "7.4.2.2 Procedure pointer assignment" ... "If proc-pointer-object has an implicit interface and is explicitly ... external:: func, sub ...
    (comp.lang.fortran)
  • Re: Erratic data entry after install MS Wireless Optical Mouse 2
    ... Accessibility options are selected. ... > touchpad while you are typing, it is going to do this. ... but data entry is now screwed up. ... >> pointer is not hidden and focus still follows the pointer. ...
    (microsoft.public.windowsxp.hardware)
  • Re: Pointer-valued function to access inner components
    ... implicit none ... Return a F90 pointer which points to the diagonal of T. ... a copyin/copyout on array A during the procedure call. ... subroutine dirty_pointer_1d ...
    (comp.lang.fortran)
  • Re: Fortran based MEX w/ COMMON/SAVE
    ... I believe dat (pointer to the array) and the ... SAVE at the begining of each subroutine is a bit unusual to me. ... > to unload it if there isn't a Fortran END or STOP statement. ... interaction w/ Matlab). ...
    (comp.soft-sys.matlab)