Hi =?Utf-8?B?dHJlZXRyZWU0MA==?=,
I am creating a form using a table where there are multiple sections (some
protected, others not). When I tab out of a cell in a non-protected area
where there is a protected are following it, Word inserts a new row rather
than moving to the next unprotected cell.
You can create a macro named NextCell that checks where you are in the table
(last row/last column) and takes the required action. Here's an example
Sub NextCell()
Dim tbl As Word.Table
Dim cel As Word.Cell
Dim rng As Word.Range
Set tbl = Selection.Tables(1)
Set cel = Selection.Cells(1)
Set rng = ActiveDocument.Sections( _
tbl.Range.Sections.Item(1).Index + 1).Range
If cel.RowIndex = tbl.Rows.Count And _
cel.ColumnIndex = tbl.Columns.Count Then
rng.FormFields(1).Select
Else
cel.Next.Select
End If
End Sub
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail