How do I prevent the addition of a new row. . .

D

DaleNDani

I need to prevent a user from creating a new row to a table when they
press the Tab key at the last cell without protecting the document. The
users that use these forms press tab to skip to the next bookmark, but
when they get to the last cell it and press tab it makes a new row
instead of jumping to the next table. Is there anyway of preventing
this?

Thank you in advance.
 
J

Jay Freedman

I need to prevent a user from creating a new row to a table when they
press the Tab key at the last cell without protecting the document. The
users that use these forms press tab to skip to the next bookmark, but
when they get to the last cell it and press tab it makes a new row
instead of jumping to the next table. Is there anyway of preventing
this?

Thank you in advance.

I think the best way is to insert form fields instead of bookmarks,
and protect the document for forms. See
http://www.computorcompanion.com/LPMArticle.asp?ID=22 for a tutorial.

The alternative is to include this macro in the template (see
http://www.gmayor.com/installing_macro.htm if needed):

Sub NextCell()
If (Selection.Cells(1).RowIndex = _
Selection.Tables(1).Rows.Count) And _
(Selection.Cells(1).ColumnIndex = _
Selection.Tables(1).Columns.Count) Then
' do nothing
Else
Selection.MoveRight unit:=wdCell
End If
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
Top