View Single Post
  #2   Report Post  
Cindy M -WordMVP-
 
Posts: n/a
Default

Hi ?B?TWFydGlucmU=?=,

If have built a word template using tables and inserting feilds into the
cells but word defaults the tab seguence left to right than down. I want to
segence the tabs where i want. It may down 5 cells than back up

This would require a macro solution. Here's some sample code that shows how it
could be done
Sub NextCell()
'Make sure the selection is in a table
If Selection.Information(wdWithInTable) Then
Dim rcount As Long, ccount As Long
Dim ri As Long, ci As Long
Dim tbl As Word.Table

Set tbl = Selection.Tables(1)
'''We need to know where we a
'In which row is the selection?
ri = Selection.Rows(1).Index
'And in which column?
ci = Selection.Columns(1).Index
'How many rows are there
rcount = tbl.Rows.Count
'And how many columns
ccount = tbl.Columns.Count

'If selection is not in the last row
If ri rcount Then
'Move down to the next cell
tbl.Cell(ri + 1, ci).Select

'If it's in the last table cell
ElseIf ri = rcount And ci = ccount Then
Dim rng As Word.Range
Set rng = tbl.Range
'Move outside the table
rng.Collapse wdCollapseEnd
rng.Select
'If the last row, but not the last column
ElseIf ri = rcount Then
'Move to the top of the next column
tbl.Cell(1, ci + 1).Select
Else
'An unexpected situation has occurred
MsgBox "There's a problem"
End If
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 :-)