Naming FF in Table

Z

zSplash

I'm trying to name some formfields I'm adding to a table. What am I
missing? Here's my code:

For X = 2 To 5
Set orng1 = ActiveDocument.Tables(2).Cell(X, 2).Range
orng1.FormFields.Add Range:=orng1, Type:=wdFieldFormTextInput
orng1.FormFields(1).Name = "Text" & X
Next

TIA, guys.
 
T

Tony Jollans

You don't say what's happening but if memory serves there is a problem doing
this in Word 2000.
 
T

Tony Jollans

Sorry - perhaps a bit more information would help. IIRC the bookmark gets
set to the table row rather than just the formfield and the way to stop it
is to collapse the range before adding the formfield.

For X = 2 To 5
Set orng1 = ActiveDocument.Tables(2).Cell(X, 2).Range
orng1.Collapse wdCollapseStart
orng1.FormFields.Add Range:=orng1, Type:=wdFieldFormTextInput
orng1.FormFields(1).Name = "Text" & X
Next
 
Top