Delete multiple linefeeds

Q

Question Boy

Hello,

I have a doc with a multitude of tables. How can I ensure that there is
only 1 linefeed between tables?

Thank you

QB
 
G

Greg Maxey

Do you mean no more than 1 paragraph mark?

Sub ScratchMacro()
Dim oTbl1 As Table
Dim oTbl2 As Table
Dim oRng As Word.Range
Dim i As Long
Dim j As Long
Set oRng = ActiveDocument.Range
For i = 1 To ActiveDocument.Tables.Count - 1
Set oTbl1 = ActiveDocument.Tables(i)
Set oTbl2 = ActiveDocument.Tables(i + 1)
oRng.Start = oTbl1.Range.End
oRng.End = oTbl2.Range.Start - 1
oRng.Text = ""
Next i
End Sub
 
Q

Question Boy

Your on the right track however your code also deletes my section page break.
Any idea how-to do exactly that while leaving the sections intact?

Thank you,

QB
 

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