Log in

View Full Version : Word: Still on forms - ActiveX controls don't let me jump between fields



avi10000
08-30-2011, 12:38 AM
(copied and edit from another list.)

Hi all,

Word 2007 & 2003

I am still on forms...

I placed some ActiveX textbox controls on my document.

I do not not protect the document. I don't want to.

I catch the _LostFocus event and do some processing for each field when the user leaves each one of the ActiveX fields.

In principle all the logic works. However, I can't use the Tab key and arrow keys to jump between adjacent ActiveX controls on the document.

From the Properties pane for the ActiveX controls it seems that there should be a 'tabbing' feature, but it does not work for me.

Ideas?

(I was thinking of programming a work around by customizing the arrow keys and tab keys to run macros and then calculating a jump based on case src->dest field, but I am having problems in setting the focus to the target control.)

These ActiveX controls are making me pull my hair out. Does VBA actually w-o-r-k? VBA programming is s-u-p-p-o-s-e-d to be one of my sources of income...

Great TIA

-avraham

avi10000
08-30-2011, 09:32 AM
I will answer my own question.

If you don't apply protection you don't get the field navigation ability.

So I will have to do it all with events and VBA.

I am astonished...

-avraham




(copied and edit from another list.)

Hi all,

Word 2007 & 2003

I am still on forms...

I placed some ActiveX textbox controls on my document.

I do not not protect the document. I don't want to.

I catch the _LostFocus event and do some processing for each field when the user leaves each one of the ActiveX fields.

In principle all the logic works. However, I can't use the Tab key and arrow keys to jump between adjacent ActiveX controls on the document.

From the Properties pane for the ActiveX controls it seems that there should be a 'tabbing' feature, but it does not work for me.

Ideas?

(I was thinking of programming a work around by customizing the arrow keys and tab keys to run macros and then calculating a jump based on case src->dest field, but I am having problems in setting the focus to the target control.)

These ActiveX controls are making me pull my hair out. Does VBA actually w-o-r-k? VBA programming is s-u-p-p-o-s-e-d to be one of my sources of income...

Great TIA

-avraham

Frosty
08-30-2011, 10:18 AM
Those controls (especially in Word 2003) were designed to be used with protected documents. That's just the way it is.

The standard way to do that was to have your "OnEntry" code unprotect the document and your OnExit code reprotect the document... I have encountered issues with "AutoOpen" routines not firing on a protected document, and the work around I discovered in Word 2003 was to use the Document_Open (of an application event-- not the ThisDocument event) event to check if a document was protected, and then fire the autoopen from there.

However, if none of the above is helpful for your process... one thought in terms of navigation would be to set your controls in table cells-- that will facilitate the use of the Tab key for navigation, although obviously there are layout considerations when you introduce the table concept.

avi10000
08-30-2011, 12:47 PM
>> Those controls (especially in Word 2003) were designed to be used with protected documents. That's just the way it is.

Yup...

>> The standard way to do that was to have your "OnEntry" code unprotect the document and your OnExit code reprotect the document...

I think that my client would have been delighted with the reverse way, i.e., have my "OnEntry" code PROTECT the document (so the form+fields stuff can work) and my OnExit code UNPROTECT the document...
LOL :-)

Meanwhile a 1 day programming job is now into its 5th day. Congrats MS...

- avraham

Frosty
08-30-2011, 02:03 PM
You're right, what I said makes no sense. The typical way to handle is...

OnEntry
Unprotect document
do your stuff
reprotect document

OnExit
Unprotect document
do your stuff
reprotect document

That's what i should have said :)

avi10000
08-30-2011, 02:39 PM
Now you are even more correct!

But I was not correcting you. I was JOKING! You see my client has no interest in protecting the document apart from to facilitate entering data into the form fields.

-avraham




You're right, what I said makes no sense. The typical way to handle is...

OnEntry
Unprotect document
do your stuff
reprotect document

OnExit
Unprotect document
do your stuff
reprotect document

That's what i should have said :)