I've tried this several ways and can't get it to work. I'm adding a macro to
a field and I want another field to change in the document based on what was
entered, but I'm having trouble referencing the field properly.
I've tried
If ActiveDocument.Text1.Text = "Hello" Then
and just
If Text1.Text = "Hello" Then
and
With ActiveDocument
If .FormFields.Text1.Text = "Hello" Then
and a couple others but I keep getting various errors. What's the proper
syntax for referencing a form field named Text 1 in a macro?
Something like this should get you on track:
Sub ScratchMacro()
With ActiveDocument
If .FormFields("Text1").Result = "Hello" Then
MsgBox "Bob's your uncle"
End If
End With
End Sub
> I've tried this several ways and can't get it to work. I'm adding a macro to
> a field and I want another field to change in the document based on what was
[quoted text clipped - 16 lines]
> and a couple others but I keep getting various errors. What's the proper
> syntax for referencing a form field named Text 1 in a macro?
Angyl - 06 Nov 2006 23:15 GMT
Many thanks, Greg.
> Something like this should get you on track:
> Sub ScratchMacro()
[quoted text clipped - 25 lines]
> > and a couple others but I keep getting various errors. What's the proper
> > syntax for referencing a form field named Text 1 in a macro?