Naming a formfield

M

Mark

I am using Word 2003, I have added a formfield with code as shown below,
declared the ffield as a formfield but the code is debugging with object
variable not set for some reason on the '.Name'. I have successfully used
this bit of code in other templates I have created. Can anyone offer me an
alternative or solution please?

Set ffield = _
ActiveDocument.FormFields.Add(Range:=Selection.Range, _
Type:=wdFieldFormTextInput)

With ffield

.Name = "contaminant"

With .TextInput

.Default = "Enter details"

End With

End With



Thanks
 

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