Jamie
Jamie

Reputation: 3931

Insert line break in MS word table

I'm trying to insert a line break into a table cell. So far I've been trying to manipulate the range of the cell, but am either getting errors or causing my text to go into subsequent rows or outside of the table.

How would I insert a line break into a table cell?

(Using macros, there is apparently a way to do it with Selection, but I'd rather avoid that if possible)

(Things I have that don't work: range.InsertParagrah, range.InsertParagraphAfter, range.Text = "\r\n", range.InsertBreak(wdLineBreak))

Upvotes: 3

Views: 12863

Answers (2)

Ed Heal
Ed Heal

Reputation: 59997

Try shift + enter - I think that does the trick.

Upvotes: 4

Phil
Phil

Reputation: 3736

This works in Word 2010, you'll need to have the correct cell etc. selected:

Selection.TypeText Text:=Chr(11)

/edit/

How about this? Forgive the use of Selection to get the range, I know you don't like it but it was the quickest way for me to test. You can use your own way to get the range.

Sub Macro3()

Dim oRange As Range
    ' Add your own range selection code here!
    Set oRange = Selection.Range
    oRange.InsertAfter (Chr(11))


End Sub

Upvotes: 2

Related Questions