Thread: [Solved] Moving Tables
View Single Post
 
Old 05-19-2011, 11:46 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,359
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi b0x4it,

Yes, it can be done with vba. Try:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long, Rng As Range
With ActiveDocument
  Set Rng = .Paragraphs.Last.Range
    With Rng
      If Len(.Text) > 1 Then
        .InsertAfter vbCr
        .Collapse wdCollapseEnd
      End If
    End With
  For i = .Tables.Count To 1 Step -1
    With .Tables(i).Range
      If .InlineShapes.Count > 0 Then
        .Cut
        With Rng
          .Paste
          .Paragraphs.First.Previous.Range.Characters.Last.InsertBefore vbCr
          .Start = .Paragraphs.First.Previous.Range.Start
          .Collapse wdCollapseStart
        End With
      End If
    End With
  Next
End With
Application.ScreenUpdating = True
End Sub
Please keep in mind that this isn't a free coding forum, though. So far, I've written quite a few macros for you - and you've asked for other macros as well ...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote