hlock was telling us:
hlock nous racontait que :
How would program Word to open a user form whenever a user enters or
clicks on an empty formfield, but not open the user form when the
formfield is not blank.
You could do it like this:
Use this macro in the onEntry event of the text formfield:
'_______________________________________
Sub RunMacro()
With Selection
If .Paragraphs(1).Range.FormFields(1).Result = "" Then
MyUserFormShow
Else
MsgBox "Do not do anything."
End If
End With
End Sub
'_______________________________________
Which will call this macro if it is empty:
'_______________________________________
Sub MyUserFormShow()
Dim myForm As frmToShow
Set myForm = New frmToShow
myForm.Show
Unload myForm
Set myForm = Nothing
End Sub
'_______________________________________
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:
http://www.word.mvps.org