Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2004

Tip: Looking for answers? Try searching our database.

How to test if textbox selected

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert - 29 Feb 2004 15:35 GMT
I have an exit macro that runs on exiting multiple textbox
formfields. If this is "TextA" then I want to do something
else. How do I test to see if "TextA" is selected?
Something like:
If ActiveDocument.FormFields("TextA").Selected then
whatever
But I can't get it to work. Is the formfield textbox still
selected when the exit macro runs? Thanks.
Jean-Guy Marcil - 29 Feb 2004 19:17 GMT
Hi Robert;,

Use this to test for the name of the currently selected formfield:

'_______________________________________
If Selection.Bookmarks(1).Name = "TextA" Then
   MsgBox "That's the right one chaps!"
Else
   MsgBox "Sorry, wrong one!"
End If
'_______________________________________

Signature

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org


> I have an exit macro that runs on exiting multiple textbox
> formfields. If this is "TextA" then I want to do something
[quoted text clipped - 4 lines]
> But I can't get it to work. Is the formfield textbox still
> selected when the exit macro runs? Thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.