Need to customize table rows for template

L

Lala3xl

Hi
I set up a template for a discussion group in Microsoft word. The brief
specified that the standard table should work as follows:
If the user inserts the table the first row should be divided up into 2
columns. When the user presses tab or inserts the next row the second row
should only have one column (merged). The third row should have 2 colums
again and the fourt one column etc. I have no idea how to tackle this
problem. Does it require XML coding?
 
G

Graham Mayor

If you insert a one row two column table, the following macro will
alternately insert one or two column rows. All odd numbered rows will have
two columns all even numbered rows will have one column. Attach to a toolbar
button or keyboard shortcut.

With Selection
.InsertRowsBelow 1
If ActiveDocument.Tables(1).Rows.Count Mod 2 = 1 Then
.Cells.Split NumRows:=1, NumColumns:=2, MergeBeforeSplit:=True
Else
.Cells.Split NumRows:=1, NumColumns:=1, MergeBeforeSplit:=True
End If
End With

http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
L

Lala3xl

Thanks this worked perfectly...now to just setup my controls and submit the
template
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top