Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-15-2012, 10:28 AM
pruppert pruppert is offline Is it possible to not select all text upon entering a form field? Mac OS X Is it possible to not select all text upon entering a form field? Office for Mac 2011
Novice
Is it possible to not select all text upon entering a form field?
 
Join Date: Jul 2012
Posts: 4
pruppert is on a distinguished road
Default Is it possible to not select all text upon entering a form field?

I am creating a document in Word for Mac 2011 that contains multiple form fields. Whenever I tab into a form field, all of the text in that field is automatically selected, which makes it very easy to accidentally overwrite with a single keystroke.

Is there are way to make it so that all of the text is not automatically selected, but so that the cursor is either at the end of the text in the form field or to have the cursor wherever it was when the user was last in that particular form field?

Some googling has led me to believe that changing the EnterFieldBehavior property may be the answer, but I have no idea how to edit this property.



http://office.microsoft.com/en-us/wo...080607616.aspx

Any help is appreciated.
Reply With Quote
  #2  
Old 07-15-2012, 03:33 PM
macropod's Avatar
macropod macropod is offline Is it possible to not select all text upon entering a form field? Windows 7 64bit Is it possible to not select all text upon entering a form field? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi pruppert,

You could only change that behaviour by using an 'On Entry' macro attached to the formfield. This means, of course, that anyone using the form would need to allow macros to run when they open the document. Although some users may do this automatically, others may have their systems configured to automatically disable all macros. As well, some Word versions (notably Mac Word 2008 and the Word Starter edition) don't support macros, so an 'On Entry' macro wouldn't help those users either.

The EnterFieldBehavior Property applies to a userform, not to formfields.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 07-15-2012, 03:40 PM
pruppert pruppert is offline Is it possible to not select all text upon entering a form field? Mac OS X Is it possible to not select all text upon entering a form field? Office for Mac 2011
Novice
Is it possible to not select all text upon entering a form field?
 
Join Date: Jul 2012
Posts: 4
pruppert is on a distinguished road
Default

Hi. Thank you for the reply.

I am the only person who would be using the form, so the issue of allowing the macro is not a problem.

I don't have any experience with writing macros, but have a very basic understanding of programming and have dabbled in Applescript.

Could you or someone point me in the directions of resources that would show how to write such a macro? Thanks.
Reply With Quote
  #4  
Old 07-15-2012, 03:58 PM
macropod's Avatar
macropod macropod is offline Is it possible to not select all text upon entering a form field? Windows 7 64bit Is it possible to not select all text upon entering a form field? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi pruppert,

In your unprotected document, press Cmd-F11 (I think) to access the vba editor. On the left side of the screen you'll see a project with your document's name. Expand that so you can see a module named 'ThisDocument'. Double-click on 'ThisDocument', then enter the following code on the main panel:
Code:
Sub Collapse()
Selection.Collapse
End Sub
Exit the vba editor (eg Cmd-F11) and return to your document. Select a formfield and, from the Developer tab, choose 'Properties. A dialogue box will pop up. Under 'Run macro on', one of the listed properties will be 'Entry'. Use the dropdown there to select 'Collapse'. Protect the document for forms. Now, whenever the formfield is selected via tabbing, the selection will collapse to the start. If you select the formfield via the mouse, the selection will collapse to the insertion point.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 07-16-2012, 03:14 PM
pruppert pruppert is offline Is it possible to not select all text upon entering a form field? Mac OS X Is it possible to not select all text upon entering a form field? Office for Mac 2011
Novice
Is it possible to not select all text upon entering a form field?
 
Join Date: Jul 2012
Posts: 4
pruppert is on a distinguished road
Default

Thanks for the help. This is close to what I want, but I would like the cursor to default to the end of the selection. The macros you give puts the cursor at the beginning of the text in the form field.
Reply With Quote
  #6  
Old 07-16-2012, 03:46 PM
pruppert pruppert is offline Is it possible to not select all text upon entering a form field? Mac OS X Is it possible to not select all text upon entering a form field? Office for Mac 2011
Novice
Is it possible to not select all text upon entering a form field?
 
Join Date: Jul 2012
Posts: 4
pruppert is on a distinguished road
Default

Nevermind. Figured it out. I just changed "Collapse" to "MoveRight".

Thank again for your help!

Phil
Reply With Quote
  #7  
Old 07-16-2012, 08:01 PM
macropod's Avatar
macropod macropod is offline Is it possible to not select all text upon entering a form field? Windows 7 64bit Is it possible to not select all text upon entering a form field? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Actually, you'd normally use:
Code:
Sub Collapse()
Selection.Collapse wdCollapseEnd
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to not select all text upon entering a form field? Macro to find text and replace with form field containing that text iiiiifffff Word VBA 16 06-04-2016 01:47 AM
Is it possible to not select all text upon entering a form field? Form Fields - Create blank form text field with if statement? LAssist2011 Word 5 12-14-2011 03:02 PM
Is it possible to not select all text upon entering a form field? Large amount of text as a form field. JustK Word 2 11-15-2011 11:17 AM
Is it possible to not select all text upon entering a form field? Creating a form to select text. ravanelli Word 1 05-20-2011 06:05 PM
Treating a text box like a form Text Field jackaroo Word 0 08-18-2010 10:20 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:48 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft