![]() |
|
#1
|
|||
|
|||
|
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. |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| List of figures with several labels (caption) - Table of Figures sorting | ibra_ca | Word | 2 | 10-11-2017 07:02 AM |
| Automatic table of figures includes one of the figures, not just the caption - help! | sarahlt | Word | 1 | 09-28-2014 09:34 AM |
| Table of Figures repeats caption references. | jorgensene | Word | 1 | 08-13-2014 03:51 PM |
| Using Insert Caption/List of figures | rezza22 | Word | 2 | 05-12-2013 09:39 AM |
Caption and Table of Figures issue
|
reece22345 | Word | 3 | 04-15-2011 12:18 AM |