Auto Tab Form Field

P

Pyrite

I've seen this script for java and wondered if anyone knows how to do this
with a macro in word? It's an Auto(form field) script - It auto tabs a form
field once its value has exceeded a certain length. For web use it looks like
this -

function autotab(original,destination){
if
(original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
destination.focus()

I just want to automatically span or jump to the next form field when I
reach the max characters in the current form field so that I can continue to
type uninterupted.

Thanks.
 
C

Cindy M -WordMVP-

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

It can't be done with form fields. The only triggers to execute macros a form field
has is when the user enters or exits.

It could be done in an ActiveX control (Controls toolbox, same controls as used in
UserForms). You'd have to check which events are available when the control is in a
document, as opposed to a UserForm. I think there's a Change event...
I've seen this script for java and wondered if anyone knows how to do this
with a macro in word? It's an Auto(form field) script - It auto tabs a form
field once its value has exceeded a certain length. For web use it looks like
this -

function autotab(original,destination){
if
(original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
destination.focus()

I just want to automatically span or jump to the next form field when I
reach the max characters in the current form field so that I can continue to
type uninterupted.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
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 :)
 
P

Pyrite

Ouch. OK, then perhaps I'm going at my problem the wrong way and there's a
simpler method to accomplish this. See if I'm making things harder than they
need to be.

Again, here's my dilemna. I have a .dot which is used both hand completion
and pc completion, so it needs to be formatted correctly for hand written
completion.

When I insert a form field with unlimited characters or enough characters to
exceed one line (no tab boundaries), at the carriage return another line is
created below pushing the remainder of the doc downward.

This doc must remain fixed and cannot grow.

See example below -

Are application methods consistent with directions?
Explain:___________________
_____________________________________________________________________
_____________________________________________________________________

If I set the field just after "Explain" then as it reaches the end of the
line it will insert a new line above the two existing lines below, driving
the doc downward. Again, I need these lines visible for hardcopy printout and
completion, so they must remain.

I just want to overwrite the line (underlined area) one character at a time.

What's the best way to accomplish this?

Again. Thanks.
 
J

Jay Freedman

I think the method that would work best for you is to set up your form
in a table, turning on/off selected cell borders to make your lines --
see #2 in http://www.word.mvps.org/FAQs/TblsFldsFms/LinesInForms.htm.

To prevent excess entry in a particular line, set the row height (in
Table > Table Properties > Row) to an Exact measurement. Also select
Table > AutoFit > Fixed Column Width to prevent horizontal expansion.
This doesn't prevent people from typing more text than will fit, but
the overflow will just disappear -- they'll get the idea eventually.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 

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