J
James III
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!
"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!