Tabbing in Microsoft Word - Disabled Fields and VBA

J

joseph m

Hi all

This is a query about tabbing in a protected Word Document (v2003), with
disabled controls.
In the word document there are OleControls. Some of these oleControls are
disabled so no text cannot be entered into them.
However whilst tabbing from an enabled field to a disabled field the cursor
gets "stuck", and cannot move from the disabled from by tabbing. The user
needs to use the mouse.
To work around this I have developed vba code to set the order of tabbing
like this.

Control 1 - Name : Customer
Control 1 - Type : textbox
Control 1 - State :enabled

Control 2 - Name : CustomerId
Control 2 - Type : textbox
Control 2 - State :disabled

Control 3 - Name : Address
Control 3 - Type : textbox
Control 3 - State :enabled

I have developed vba code to link a keydown event on the customer field to
the address field, if the key input is a tab key

private sub cusomer_keyDown(byval keyCode as MSforms.ReturnInteger, _
byval shift as integer)
if keyCode = VBA.vbKeyTab then
Address.select
End if
End sub

The problem is, most of the time this works, however on certain computers
with the same version of Word installed as mine, the tabbing does not follow
this order !
It seems to create a random order, and positions the oleControl on a
different textbox, one that was not specified in "tab-linking"

I have come to this discussion group to find if anybody has experienced the
same issue as this, and to look for a fix or a work around to this.

Thanks in advance

Joseph
 
C

Cindy M.

Hi =?Utf-8?B?am9zZXBoIG0=?=,

Can you explain why you're using disabled OLE text box controls in the
document? My inclination would be to seek an alternative to those...
This is a query about tabbing in a protected Word Document (v2003), with
disabled controls.
In the word document there are OleControls. Some of these oleControls are
disabled so no text cannot be entered into them.
However whilst tabbing from an enabled field to a disabled field the cursor
gets "stuck", and cannot move from the disabled from by tabbing. The user
needs to use the mouse.
To work around this I have developed vba code to set the order of tabbing
like this.

Control 1 - Name : Customer
Control 1 - Type : textbox
Control 1 - State :enabled

Control 2 - Name : CustomerId
Control 2 - Type : textbox
Control 2 - State :disabled

Control 3 - Name : Address
Control 3 - Type : textbox
Control 3 - State :enabled

I have developed vba code to link a keydown event on the customer field to
the address field, if the key input is a tab key

private sub cusomer_keyDown(byval keyCode as MSforms.ReturnInteger, _
byval shift as integer)
if keyCode = VBA.vbKeyTab then
Address.select
End if
End sub

The problem is, most of the time this works, however on certain computers
with the same version of Word installed as mine, the tabbing does not follow
this order !
It seems to create a random order, and positions the oleControl on a
different textbox, one that was not specified in "tab-linking"

I have come to this discussion group to find if anybody has experienced the
same issue as this, and to look for a fix or a work around to this.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top