View Single Post
 
Old 05-12-2018, 01:17 AM
datdude datdude is offline Windows 10 Office 2013
Novice
 
Join Date: May 2018
Posts: 2
datdude is on a distinguished road
Default Changing figures' caption from bottom to above

I have many figures in my document, those figures have their captions at the bottom. I need to move the caption to above. How can I achieve that? preferably, change them in batch mode or macro. I found a macro online to change caption for tables from bottom to above, but couldn't get it to work with figures.

Code:
Sub UpdateTables()
Application.ScreenUpdating = False
Dim i As Long, oPrev As Range, oNext As Range
With ActiveDocument
  For i = .Tables.Count To 1 Step -1
    With .Tables(i).Range
      Set oPrev = .Characters.First.Previous.Characters.Last
      Set oNext = .Characters.Last.Next.Paragraphs.First.Range
      With oPrev
        .InsertBefore vbCr
        .Start = .End - 1
        .Style = oNext.Style
        .End = .Start
        If Len(oNext.Text) > 1 Then
          With oNext
            .End = .End - 1
            .Cut
            .Delete
          End With
          .Paste
        Else
          oNext.Delete
        End If
      End With
    End With
  Next
End With
Application.ScreenUpdating = True
End Sub

Last edited by Charles Kenyon; 05-12-2018 at 10:03 AM.
Reply With Quote