How to test if textbox selected

R

Robert

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.
 
J

Jean-Guy Marcil

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
'_______________________________________

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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