Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-23-2020, 11:13 PM
kae0088 kae0088 is offline Moving pictures/tables with captions Windows 7 64bit Moving pictures/tables with captions Office 2010 32bit
Novice
 
Join Date: May 2012
Location: Melbourne, Australia
Posts: 20
kae0088 is on a distinguished road
Default

Rather than insert the shape and caption in a single cell table, I prefer to put them together in a group. The group is itself a floating shape that can be moved around, the sequence numbering changing if necessary – don’t forget to update all fields to get the new seq numbers.



The macro AddCaptionToFloatingShape will add a caption and group the caption with the shape.
Code:
Sub AddCaptionToFloatingShape()
Dim aShape As Shape
Dim shpName1 As String
Dim shpName2 As String
    If Selection.ShapeRange.Count <> 1 Then MsgBox "Floating shape not selected": Exit Sub
    shpName1 = Selection.ShapeRange(1).Name
    If Dialogs(wdDialogInsertCaption).Show Then
        shpName2 = Selection.ShapeRange(1).Name
        Selection.ShapeRange(1).Anchor.Select
        Selection.Collapse
        Set aShape = ActiveDocument.Shapes.Range(Array(shpName1, shpName2)).Group
    End If
End Sub
Reply With Quote
Reply

Tags
caption, caption; figures; tables



Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving pictures/tables with captions Macro to add captions to pictures inside word document Navis Word VBA 18 12-11-2019 03:39 PM
Moving pictures/tables with captions Table of tables and of other captions Messoloras Word 2 08-15-2018 04:57 AM
Moving pictures/tables with captions Different captions for tables & graphics rebfein Word 3 07-28-2018 12:47 PM
Moving pictures/tables with captions creating tables for row of figures and captions gib65 Word 2 08-12-2011 01:25 PM
Moving pictures/tables with captions Captions (tables and figures) mcjohn Word 1 02-11-2010 10:36 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:17 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2026 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft