MS Word: Center align only image in a list
I have made a numbered list in Word 2010. Each list entry has an image as well. I want to center align all images, but when I try to center align an image, the text above get centered as well.
How can I center align images in the list without centering the text above and below.
3 Answers
Ok, here's what you do:
- Right click on the image and select, 'Size & Position...'
- Select the 'Text Wrapping' tab
- Select 'Top & Bottom'
- Select the 'Position' tab
- Under the 'Horizontal' section, select 'Alignment' and then select 'Centered' relative to 'Column'
Unfortunately, doing this for multiple images is problematic. Format painter won't work. Also, simply using the Macro Recorder causes problems when trying to select the image.
So, creating a VBA macro and binding it to a key would seem to be the only way forward to make this super-efficient. Here are two helpful posts in this regard:
From the first of these references, I have tested the following VBA macro. Seems to work fine!
Sub FormatMyPicture() Dim myShape As Shape If Selection.InlineShapes.Count > 0 Then Set myShape = Selection.InlineShapes(1).ConvertToShape ElseIf Selection.ShapeRange.Count > 0 Then Set myShape = Selection.ShapeRange(1) Else MsgBox "Please select a picture first." Exit Sub End If With myShape .WrapFormat.Type = wdWrapTopBottom .WrapFormat.DistanceTop = InchesToPoints(0.2) .WrapFormat.DistanceBottom = InchesToPoints(0.2) .RelativeHorizontalPosition = wdRelativeHorizontalPositionPage .Left = wdShapeCenter End With
End Sub 7 To align center all inline image in MS Word:
Step 1: Press Alt+F11 to open VBA Editor
Step 2: Go to Insert then Module
Step 3: In the VBA Editor type following code snippet
Sub centerPictures() Dim shpIn As InlineShape, shp As Shape For Each shpIn In ActiveDocument.InlineShapes shpIn.Select Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Next shpIn For Each shp In ActiveDocument.Shapes shp.Select Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Next shp
End SubStep 4: Press F5 or press Run Sub to apply this change
Hope this wil help someone special
Sub rezize_center_newline()
Dim i As Long
Dim shpIn As InlineShape, shp As Shape
With ActiveDocument For i = 1 To .InlineShapes.Count With .InlineShapes(i) .Height = InchesToPoints(4) .Width = InchesToPoints(5.32) .Range.InsertAfter Chr(13) End With Next i For Each shpIn In ActiveDocument.InlineShapes shpIn.Select Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Next shpIn For Each shp In ActiveDocument.Shapes shp.Select Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Next shp
End With
End Sub