Jay
Fri Mar 09 09:26:22 CST 2007
Al wrote:
> This may be asking too much but here goes
>
> I need a macro to insert a Paragraph Mark at the end of each table
> cell
>
> I have tried looking for examples of code but so far no luck
>
> Thanks
> Al
If any of the following is still a mystery, post back and point to what you
don't understand.
Sub AddParaToEachCell()
Dim myTable As Table
Dim myCell As Cell
Dim myRange As Range
For Each myTable In ActiveDocument.Tables
For Each myCell In myTable.Range.Cells
Set myRange = myCell.Range
With myRange
' move the end of the range to
' the spot between the last
' character and the cell marker
.MoveEnd wdCharacter, -1
' collapse the range to that spot
.Collapse wdCollapseEnd
' insert a paragraph mark
.Text = vbCr
End With
Next
Next
End Sub
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ:
http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.