Group: microsoft.public.word.vba.general
From: Helmut Weber
Date: Monday, March 31, 2008 8:47 AM
Subject: Re: add checkbox to table programatically

Hi Cyberwolf,

maybe like that:

Sub NextCell()
Dim rTbl As Range
Set rTbl = Selection.Tables(1).Range
' if the selection is in the last cell of a table
If Selection.Cells(1).Range.IsEqual( _
rTbl.Cells(rTbl.Cells.Count).Range) Then
Selection.Rows(1).Range.Copy
Selection.Tables(1).Rows.Add
Selection.Tables(1).Rows.Last.Select
Selection.Paste
Selection.Rows(1).Delete
Selection.MoveUp unit:=wdLine
Else
Selection.Cells(1).Next.Select
Selection.Collapse
End If
End Sub

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP

Safety Articles | Usenet Groups | Usenet News | Bluegrass